------- Additional Comments From reichelt at gcc dot gnu dot org  2005-02-10 
21:13 -------
The ICE is gone now (probably due to one of Mark's patches today/yesterday).
But the diagnostic is still hosed on the 3.4 branch. The following code
snippet

============================
template<char> struct A
{
    A<char>::~A() {}
};
============================

is rejected with the following error message:

PR19441.cc:3: error: type/value mismatch at argument 1 in template parameter
list for `template<char <anonymous> > struct A'
PR19441.cc:3: error:   expected a constant of type `char', got `char'
PR19441.cc:3: error: ISO C++ forbids declaration of `type name' with no type
PR19441.cc:3: error: abstract declarator `int' used as declaration
PR19441.cc:3: error: expected `;' before "A"
PR19441.cc:4: error: expected `;' before '}' token

The first two lines are OK (this is what one gets with 3.3 branch or mainline).
The other 4 lines are more or less bogus. There's not even an 'int' in the
code. It's probably generated by the compiler because of the declaration
with no type, but it can easily confuse the user.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|error-recovery, ice-on-     |diagnostic
                   |invalid-code                |
            Summary|[3.4 regression] ICE with   |[3.4 regression] Bad error
                   |invalid destructor          |message with invalid
                   |declaration                 |destructor declaration


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

Reply via email to