[Bug c++/85790] New: c++17 - Access control issue with template argument deduction
paolo.monteverde at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue May 15 10:59:00 GMT 2018
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
More information about the Gcc-bugs
mailing list