http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57973
Bug ID: 57973
Summary: incorrect access check for protected member of
template base with using
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: rogero at howzatt dot demon.co.uk
Created attachment 30547
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30547&action=edit
sample program -- I believe this should compile.
In a template class where a protected member of a template base class is the
subject of a using declaration, atempting to form pointer-to-member fails.
I have tested with:
mingw g++ (niXman build) 4.7.0 20120203 (experimental)
www.ideone.com (gcc 4.7.2)
www.godbolt.com (gcc 4.4.7, 4.5.3, 4.6.4, 4.7.3, 4.8.1)
the program fails to compile on each with these errors:
prog.cpp: In instantiation of ‘bool D<T>::testB() const [with T = int]’:
prog.cpp:37:12: required from here
prog.cpp:22:17: error: ‘using B<T>::bptr’ is inaccessible
prog.cpp:25:18: error: within this context
I beleive the code is correct, and it is accepted by:
clang 3.0.6
icc 13.0
msvc 12