This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20589] error: '<anonymous enum>' is/uses anonymous type'
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Mar 2005 18:53:05 -0000
- Subject: [Bug c++/20589] error: '<anonymous enum>' is/uses anonymous type'
- References: <20050322154540.20589.caolanm@redhat.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2005-03-23 18:53 -------
Intuitively, C++ treats unnamed enums differently than named ones, because
in templates the function/class name has to be mangled, and will contain
the name of the template arguments. If the template argument doesn't have
a name, then the compiler can't do its job, so the standard chose to
disallow unnamed enums as template arguments.
For more legalese, this is specified in section 14.3.1/2 of the standard,
which says:
2 A local type, a type with no linkage, an unnamed type or a type
compounded from any of these types shall not be used as a template-
argument for a template type-parameter. [Example: ...
Regards
Wolfgang
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20589