https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85790
Bug ID: 85790 Summary: c++17 - Access control issue with template argument deduction Product: gcc Version: 8.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: paolo.monteverde at gmail dot com Target Milestone: --- struct B { protected: static constexpr unsigned i = 0; }; template<unsigned= 0> struct D : public B { D(unsigned = B::i) {} }; int main() { D w{}; } This results in an error related to B::i being protected. No error is detected if I explicitly declare D being a template class through "D<> w{};". Command line: `g++ prog.cc -Wall -Wextra -std=c++17` Check this on https://wandbox.org/permlink/NnoaLEU6p4GZdJzs