https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78330
Bug ID: 78330 Summary: incorrectly accepts invalid C++ code with shadowed template parameter Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu Target Milestone: --- This affects at least as early as 4.8.x till the latest trunk. $ g++-trunk -v Using built-in specs. COLLECT_GCC=g++-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.0 20161111 (experimental) [trunk revision 242066] (GCC) $ $ g++-trunk -c test.cpp $ $ icc -c test.cpp test.cpp(1): error: a template template parameter cannot have the same name as one of its template parameters template < template < class T > class T > class A {}; ^ compilation aborted for test.cpp (code 2) $ ------------------------------------------------------- template < template < class T > class T > class A {};