public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19441] New: [3.4 regression] ICE with invalid destructor declaration
@ 2005-01-14 11:50 reichelt at gcc dot gnu dot org
  2005-01-14 13:27 ` [Bug c++/19441] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-01-14 11:50 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code snippet causes an ICE in gcc 3.4.x:

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

bug.cc:3: error: type/value mismatch at argument 1 in template parameter list
for `template<int <anonymous> > struct A'
bug.cc:3: error:   expected a constant of type `int', got `int'
bug.cc:3: internal compiler error: in grokdeclarator, at cp/decl.c:6534
Please submit a full bug report, [etc.]

-- 
           Summary: [3.4 regression] ICE with invalid destructor declaration
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/19441] [3.4 regression] ICE with invalid destructor declaration
  2005-01-14 11:50 [Bug c++/19441] New: [3.4 regression] ICE with invalid destructor declaration reichelt at gcc dot gnu dot org
@ 2005-01-14 13:27 ` pinskia at gcc dot gnu dot org
  2005-02-10 23:56 ` [Bug c++/19441] [3.4 regression] Bad error message " reichelt at gcc dot gnu dot org
  2005-05-19 17:48 ` mmitchel at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-14 13:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-14 13:27 -------
Broken:
: Search converges between 2003-08-06-trunk (#316) and 2003-08-07-trunk (#317).
Fixed on the mainline
: Search converges between 2004-09-12-trunk (#538) and 2004-09-14-trunk (#539).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-01-14 13:27:09
               date|                            |
   Target Milestone|---                         |3.4.4


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/19441] [3.4 regression] Bad error message with invalid destructor declaration
  2005-01-14 11:50 [Bug c++/19441] New: [3.4 regression] ICE with invalid destructor declaration reichelt at gcc dot gnu dot org
  2005-01-14 13:27 ` [Bug c++/19441] " pinskia at gcc dot gnu dot org
@ 2005-02-10 23:56 ` reichelt at gcc dot gnu dot org
  2005-05-19 17:48 ` mmitchel at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-02-10 23:56 UTC (permalink / raw)
  To: gcc-bugs


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/19441] [3.4 regression] Bad error message with invalid destructor declaration
  2005-01-14 11:50 [Bug c++/19441] New: [3.4 regression] ICE with invalid destructor declaration reichelt at gcc dot gnu dot org
  2005-01-14 13:27 ` [Bug c++/19441] " pinskia at gcc dot gnu dot org
  2005-02-10 23:56 ` [Bug c++/19441] [3.4 regression] Bad error message " reichelt at gcc dot gnu dot org
@ 2005-05-19 17:48 ` mmitchel at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-05-19 17:48 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.4                       |3.4.5


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/19441] [3.4 regression] Bad error message with invalid destructor declaration
       [not found] <bug-19441-1771@http.gcc.gnu.org/bugzilla/>
  2005-10-07  3:49 ` gdr at gcc dot gnu dot org
@ 2005-12-08 13:42 ` reichelt at gcc dot gnu dot org
  1 sibling, 0 replies; 6+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-12-08 13:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from reichelt at gcc dot gnu dot org  2005-12-08 13:42 -------
This is now also fixed on the 3.4 branch (probably by the patch for PR19397).
We now get the following error message:

bug.cc:3: error: type/value mismatch at argument 1 in template parameter list
for `template<char <anonymous> > struct A'
bug.cc:3: error:   expected a constant of type `char', got `char'


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/19441] [3.4 regression] Bad error message with invalid destructor declaration
       [not found] <bug-19441-1771@http.gcc.gnu.org/bugzilla/>
@ 2005-10-07  3:49 ` gdr at gcc dot gnu dot org
  2005-12-08 13:42 ` reichelt at gcc dot gnu dot org
  1 sibling, 0 replies; 6+ messages in thread
From: gdr at gcc dot gnu dot org @ 2005-10-07  3:49 UTC (permalink / raw)
  To: gcc-bugs



-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |gdr at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-09-04 18:20:31         |2005-10-07 03:49:53
               date|                            |
   Target Milestone|3.4.5                       |3.4.6


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-12-08 13:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-14 11:50 [Bug c++/19441] New: [3.4 regression] ICE with invalid destructor declaration reichelt at gcc dot gnu dot org
2005-01-14 13:27 ` [Bug c++/19441] " pinskia at gcc dot gnu dot org
2005-02-10 23:56 ` [Bug c++/19441] [3.4 regression] Bad error message " reichelt at gcc dot gnu dot org
2005-05-19 17:48 ` mmitchel at gcc dot gnu dot org
     [not found] <bug-19441-1771@http.gcc.gnu.org/bugzilla/>
2005-10-07  3:49 ` gdr at gcc dot gnu dot org
2005-12-08 13:42 ` reichelt at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).