This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/3478] [3.4 regression] Accepts invalid enum declarations from template class


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]