Bug 48093 - gcc C++ internal error on incorrect usage of "typename"
Summary: gcc C++ internal error on incorrect usage of "typename"
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.1
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-07-09 16:52 UTC by Kenton Varda
Modified: 2007-04-18 16:34 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2001-07-25 14:50:56 UTC
Embargoed:


Attachments (Terms of Use)

Description Kenton Varda 2001-07-09 16:52:50 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.2-2 i686; en-US; 0.7) Gecko/20010316

Description of problem:
This code is not valid C++.  However, it crashes GCC.

template<typename T>
void f()
{
    typename T::u;  //incorrect C++
}


How reproducible:
Always

Steps to Reproduce:
Compile the code

Actual Results:
testgcctypenamebug.cpp: In function `void f ()':
testgcctypenamebug.cpp:4: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.

Expected Results:
Some form of error indicating that the code is incorrect.

Additional info:

This bug is only relevant to those of us who learn C++ by writing code and
seeing if GCC compiles it.  :)

Comment 1 Jakub Jelinek 2001-07-25 14:50:51 UTC
Fixed with http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00490.html
which will be included in gcc-c++-2.96-96.


Note You need to log in before you can comment on or make changes to this bug.