Hi all, Below, GCC forgets to check the accessibility of "type", which turns out to be private: $ cat foo.cc class foo { typedef int type; }; template <typename T> foo::type bar() { return 1; } int main() { return bar<char>(); } $ g++-mp-4.9 -Wall foo.cc $ clang++-mp-3.1 -Wall foo.cc foo.cc:7:6: error: 'type' is a private member of 'foo' foo::type bar() ^ foo.cc:3:15: note: implicitly declared private here typedef int type; ^ 1 error generated. All the GCCs I have access to (4.4 .. 4.9) exhibit the same behavior. Cheers!
Dup. *** This bug has been marked as a duplicate of bug 47346 ***