This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/3478] [3.4 regression] Accepts invalid enum declarations from template class
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Dec 2003 15:26:42 -0000
- Subject: [Bug c++/3478] [3.4 regression] Accepts invalid enum declarations from template class
- References: <20010629080601.3478.jthorn@thp.univie.ac.at>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From reichelt at gcc dot gnu dot org 2003-12-18 15:26 -------
Here's an updated testcase to match Nathan's and Giovanni's comment:
-------------------------------------------------------------------------------
template <typename> struct A
{
enum E {};
};
template <typename T> void foo()
{
enum A<void>::E e1; // OK
typename A<T>::E e2; // OK
enum A<T>::E e3; // OK, see DR 180
enum typename A<T>::E e4; // invalid, violates [7.1.5.3]
}
-------------------------------------------------------------------------------
Mainline wrongly accepts all versions.
(The 3.3 branch correctly rejects e4, but ICEs on e3.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3478