public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/38638]  New: [4.2/4.3/4.4 regression] ICE superfluous 'typename'
@ 2008-12-26 22:36 reichelt at gcc dot gnu dot org
  2008-12-26 22:37 ` [Bug c++/38638] " reichelt at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-12-26 22:36 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code snippet triggers an ICE since GCC 4.2.0:

========================================
struct A
{
  template<int> void foo(int i)
  {
    typename A::foo<0>(i);
  }
};
========================================

bug.cc: In member function 'void A::foo(int)':
bug.cc:5: internal compiler error: in start_decl, at cp/decl.c:4189
Please submit a full bug report, [etc.]

The code was wrongly accepted by GCC 3.4.x, 4.0.x, and 4.1.x.
It was correctly rejected by GCC 3.3.6 and earlier.


-- 
           Summary: [4.2/4.3/4.4 regression] ICE superfluous 'typename'
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

* [Bug c++/38638] [4.2/4.3/4.4 regression] ICE superfluous 'typename'
  2008-12-26 22:36 [Bug c++/38638] New: [4.2/4.3/4.4 regression] ICE superfluous 'typename' reichelt at gcc dot gnu dot org
@ 2008-12-26 22:37 ` reichelt at gcc dot gnu dot org
  2008-12-27  1:31 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-12-26 22:37 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.2.5


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


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

* [Bug c++/38638] [4.2/4.3/4.4 regression] ICE superfluous 'typename'
  2008-12-26 22:36 [Bug c++/38638] New: [4.2/4.3/4.4 regression] ICE superfluous 'typename' reichelt at gcc dot gnu dot org
  2008-12-26 22:37 ` [Bug c++/38638] " reichelt at gcc dot gnu dot org
@ 2008-12-27  1:31 ` pinskia at gcc dot gnu dot org
  2008-12-29 22:52 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-27  1:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-12-27 01:29 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |4.4.0 4.3.0
      Known to work|                            |3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2008-12-27 01:29:47
               date|                            |


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


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

* [Bug c++/38638] [4.2/4.3/4.4 regression] ICE superfluous 'typename'
  2008-12-26 22:36 [Bug c++/38638] New: [4.2/4.3/4.4 regression] ICE superfluous 'typename' reichelt at gcc dot gnu dot org
  2008-12-26 22:37 ` [Bug c++/38638] " reichelt at gcc dot gnu dot org
  2008-12-27  1:31 ` pinskia at gcc dot gnu dot org
@ 2008-12-29 22:52 ` rguenth at gcc dot gnu dot org
  2008-12-31 23:09 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-29 22:52 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug c++/38638] [4.2/4.3/4.4 regression] ICE superfluous 'typename'
  2008-12-26 22:36 [Bug c++/38638] New: [4.2/4.3/4.4 regression] ICE superfluous 'typename' reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-12-29 22:52 ` rguenth at gcc dot gnu dot org
@ 2008-12-31 23:09 ` pinskia at gcc dot gnu dot org
  2008-12-31 23:18 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-31 23:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-12-31 23:08 -------
I think I have a simple parser fix for this.
Index: parser.c
===================================================================
--- parser.c    (revision 142986)
+++ parser.c    (working copy)
@@ -11537,7 +11537,11 @@ cp_parser_elaborated_type_specifier (cp_
        type = make_typename_type (parser->scope, decl,
                                   typename_type,
                                   /*complain=*/tf_error);
-      else
+      /* If the `typename' keyword is in effect and DECL is not a type decl.
Then
+         type is non existant.   */
+      else if (tag_type == typename_type && TREE_CODE (decl) != TYPE_DECL)
+         type = NULL_TREE; 
+      else 
        type = TREE_TYPE (decl);
     }

But I need to check if we could get anything besides typedecl here really.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2008-12-27 01:29:47         |2008-12-31 23:08:25
               date|                            |


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


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

* [Bug c++/38638] [4.2/4.3/4.4 regression] ICE superfluous 'typename'
  2008-12-26 22:36 [Bug c++/38638] New: [4.2/4.3/4.4 regression] ICE superfluous 'typename' reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-12-31 23:09 ` pinskia at gcc dot gnu dot org
@ 2008-12-31 23:18 ` pinskia at gcc dot gnu dot org
  2009-03-27  7:21 ` andreasmeier80 at gmx dot de
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-31 23:18 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/38638] [4.2/4.3/4.4 regression] ICE superfluous 'typename'
  2008-12-26 22:36 [Bug c++/38638] New: [4.2/4.3/4.4 regression] ICE superfluous 'typename' reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-12-31 23:18 ` pinskia at gcc dot gnu dot org
@ 2009-03-27  7:21 ` andreasmeier80 at gmx dot de
  2009-03-27 13:37 ` hjl at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: andreasmeier80 at gmx dot de @ 2009-03-27  7:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from andreasmeier80 at gmx dot de  2009-03-27 07:20 -------
Approved: http://gcc.gnu.org/ml/gcc-patches/2009-03/msg01084.html


-- 


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


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

* [Bug c++/38638] [4.2/4.3/4.4 regression] ICE superfluous 'typename'
  2008-12-26 22:36 [Bug c++/38638] New: [4.2/4.3/4.4 regression] ICE superfluous 'typename' reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2009-03-27  7:21 ` andreasmeier80 at gmx dot de
@ 2009-03-27 13:37 ` hjl at gcc dot gnu dot org
  2009-03-31 21:05 ` [Bug c++/38638] [4.3 " jsm28 at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl at gcc dot gnu dot org @ 2009-03-27 13:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl at gcc dot gnu dot org  2009-03-27 13:36 -------
Subject: Bug 38638

Author: hjl
Date: Fri Mar 27 13:36:33 2009
New Revision: 145107

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145107
Log:
gcc/cp/

2009-03-27  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR c++/38638
        * parser.c (cp_parser_elaborated_type_specifier): If we have a
        typename tag and don't have either a TYPE_DECL or a
        TEMPLATE_ID_EXPR, set the type to NULL.

gcc/testsuite/

2009-03-27  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR c++/38638
        * g++.dg/template/typename17.C: New testcase.
        * g++.dg/template/typename18.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/template/typename17.C
    trunk/gcc/testsuite/g++.dg/template/typename18.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/38638] [4.3 regression] ICE superfluous 'typename'
  2008-12-26 22:36 [Bug c++/38638] New: [4.2/4.3/4.4 regression] ICE superfluous 'typename' reichelt at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-03-27 13:37 ` hjl at gcc dot gnu dot org
@ 2009-03-31 21:05 ` jsm28 at gcc dot gnu dot org
  2009-04-16 15:45 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 21:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jsm28 at gcc dot gnu dot org  2009-03-31 21:05 -------
Closing 4.2 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.2/4.3 regression] ICE    |[4.3 regression] ICE
                   |superfluous 'typename'      |superfluous 'typename'
   Target Milestone|4.2.5                       |4.3.4


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


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

* [Bug c++/38638] [4.3 regression] ICE superfluous 'typename'
  2008-12-26 22:36 [Bug c++/38638] New: [4.2/4.3/4.4 regression] ICE superfluous 'typename' reichelt at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2009-03-31 21:05 ` [Bug c++/38638] [4.3 " jsm28 at gcc dot gnu dot org
@ 2009-04-16 15:45 ` pinskia at gcc dot gnu dot org
  2009-08-04 12:45 ` rguenth at gcc dot gnu dot org
  2009-11-08  4:18 ` jason at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-16 15:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2009-04-16 15:45 -------
I am no longer working on this one.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|pinskia at gcc dot gnu dot  |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW


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


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

* [Bug c++/38638] [4.3 regression] ICE superfluous 'typename'
  2008-12-26 22:36 [Bug c++/38638] New: [4.2/4.3/4.4 regression] ICE superfluous 'typename' reichelt at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2009-04-16 15:45 ` pinskia at gcc dot gnu dot org
@ 2009-08-04 12:45 ` rguenth at gcc dot gnu dot org
  2009-11-08  4:18 ` jason at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-04 12:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from rguenth at gcc dot gnu dot org  2009-08-04 12:29 -------
GCC 4.3.4 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.4                       |4.3.5


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


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

* [Bug c++/38638] [4.3 regression] ICE superfluous 'typename'
  2008-12-26 22:36 [Bug c++/38638] New: [4.2/4.3/4.4 regression] ICE superfluous 'typename' reichelt at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2009-08-04 12:45 ` rguenth at gcc dot gnu dot org
@ 2009-11-08  4:18 ` jason at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-11-08  4:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jason at gcc dot gnu dot org  2009-11-08 04:18 -------
Fixed in 4.4.0, not going to fix in 4.3 branch.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.3.5                       |4.4.0


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


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

end of thread, other threads:[~2009-11-08  4:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-26 22:36 [Bug c++/38638] New: [4.2/4.3/4.4 regression] ICE superfluous 'typename' reichelt at gcc dot gnu dot org
2008-12-26 22:37 ` [Bug c++/38638] " reichelt at gcc dot gnu dot org
2008-12-27  1:31 ` pinskia at gcc dot gnu dot org
2008-12-29 22:52 ` rguenth at gcc dot gnu dot org
2008-12-31 23:09 ` pinskia at gcc dot gnu dot org
2008-12-31 23:18 ` pinskia at gcc dot gnu dot org
2009-03-27  7:21 ` andreasmeier80 at gmx dot de
2009-03-27 13:37 ` hjl at gcc dot gnu dot org
2009-03-31 21:05 ` [Bug c++/38638] [4.3 " jsm28 at gcc dot gnu dot org
2009-04-16 15:45 ` pinskia at gcc dot gnu dot org
2009-08-04 12:45 ` rguenth at gcc dot gnu dot org
2009-11-08  4:18 ` jason 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).