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++/14479] enum definition in template class with template methods causes error.


------- Additional Comments From bangerth at dealii dot org  2004-03-08 15:13 -------
Confirmed. This is totally bogus: 
------------------ 
template <int dim>  
struct X { 
    enum { dimension = dim }; 
    template<int d> void bar () ; 
}; 
 
template <> 
template <>   
void X<0>::bar<0> () {} 
---------------------- 
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc 
x.cc: In instantiation of `X<0>': 
x.cc:9:   instantiated from here 
x.cc:3: error: too many template parameter lists in declaration of 
`X<0>::<anonymous enum>' 
 
This should really compile, but apparently doesn't, and never did going back 
to at least gcc 2.95.3. Furthermore, the error message does not tell anything 
at all about what the compiler doesn't understand. 
 
Up until 3.2.3, we issued the following message instead: 
g/x> /home/bangerth/bin/gcc-3.2.*/bin/c++ -c x.cc 
x.cc: In instantiation of `X<0>': 
x.cc:9:   instantiated from here 
x.cc:9: too many template parameter lists in declaration of `X<0>::<anonymous  
   enum>' 
 
Note the change in location for the last error line -- maybe this triggers 
something with someone... 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|diagnostic                  |rejects-valid
      Known to fail|                            |2.95.3 3.2.3 3.3.3 3.4.0
                   |                            |3.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-03-08 15:13:41
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14479


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