[Bug c++/78330] incorrectly accepts invalid C++ code with shadowed template parameter

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Oct 12 10:29:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78330

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I suspect that GCC  and Clang simply forget the names of the
template-parameter-list <class T> as soon as it's been parsed, because those
names have no purpose and can't be referred to outside that
template-parameter-list anyway.

But strictly speaking, ICC is right that the names are still in scope and so
collide with the template's own name.


More information about the Gcc-bugs mailing list