This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19441] [3.4 regression] Bad error message with invalid destructor declaration
- 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: 10 Feb 2005 21:13:39 -0000
- Subject: [Bug c++/19441] [3.4 regression] Bad error message with invalid destructor declaration
- References: <20050114115032.19441.reichelt@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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