Why is a member template from private base class introduced with a using declaration inaccessible?
c++, clang, compiler-errors, gcc, visual-c++
Solution
[namespace.udecl]/p18:
The alias created by the using-declaration has the usual accessibility for a member-declaration.
Not much to say here. The name `B::C` is publicly accessible, and the code is well-formed. Just another MSVC bug.
Problem
Consider the following (artificial) example: ``` class A { public: template <typename T> class C {}; }; class B : private A { public: using A::C; }; int main() { B::C<int> c; } ``` It compiles successfully with both GCC and Clang, but Visual C++ 2010 gives the following error: test.cpp(13): error C2247: 'A::C' not accessible because 'B' uses 'private' to inherit from 'A' Is this a bug in Visual C++ or this code is indeed invalid? If `C` is not a template, the code compiles on all compilers.