public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/71825] incorrectly rejects valid C++ code with a template class inside a namespace
       [not found] <bug-71825-4@http.gcc.gnu.org/bugzilla/>
@ 2021-12-09  1:04 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: pinskia at gcc dot gnu.org @ 2021-12-09  1:04 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |accepts-invalid, diagnostic

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
ICC rejects this with:
<source>(7): error: class template and template parameter may not have the same
name
  template < class A > struct N::A 
                                 ^

When struct A is not in a namespace GCC, clang and MSVC all reject it with a
similar message. I suspect ICC gets this right really. That is it should be
rejected due to the name being the same.

In fact if we did:
namespace N 
{
template < class A > struct A 
{
};
}

GCC, clang and MSVC reject it too.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-09  1:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-71825-4@http.gcc.gnu.org/bugzilla/>
2021-12-09  1:04 ` [Bug c++/71825] incorrectly rejects valid C++ code with a template class inside a namespace pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).