Bug 48093

Summary: gcc C++ internal error on incorrect usage of "typename"
Product: [Retired] Red Hat Linux Reporter: Kenton Varda <temporal>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: low Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-07-25 14:50:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.