Bug 204395 - gcc segmentation fault when typename preceeds specified template
Summary: gcc segmentation fault when typename preceeds specified template
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
: 204394 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-08-28 20:50 UTC by Peter Tippett
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-29 08:32:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Peter Tippett 2006-08-28 20:50:39 UTC
Description of problem:
When compiling code that uses the typename keyword against a template that 
hasn't been typedef'd (I'm actually not sure how best to describe it... but 
it's trivial to reproduce) then you get a segmentation fault.

Version-Release number of selected component (if applicable):
The version of Linux (uname -a) is actually:
Linux vanpglnx29 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005 i686 i686 
i386 GNU/Linux
and the version of gcc (gcc --version) is:
gcc (GCC) 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)

How reproducible:
Every time.

Steps to Reproduce:
Compile the following cpp program using gcc (e.g. gcc test.cpp).
  
Actual results:
Segmentation fault.

Expected results:
No segmentation fault.

Additional info:
Try to compile this code:

#include <map>
using namespace std;

int main (int argv, char** argc) {
  map<int,int> mymap;
  mymap.insert(typename map<int,int>::value_type(1,1));
  return 0;
}

Comment 1 Jakub Jelinek 2006-08-29 08:32:59 UTC
This report is confusing because RHEL3 doesn't ship gcc-3.4.3-9.EL4.
In any case, this is correctly flagged as an error without any internal compiler
errors in current RHEL4 updates:
rpm -q gcc-c++; g++ a.C
gcc-c++-3.4.6-3
a.C: In function `int main(int, char**)':
a.C:6: error: using `typename' outside of template
Even RHEL3 gcc-3.2.3-56 issues the same error.

Comment 2 Jakub Jelinek 2006-08-29 08:36:18 UTC
*** Bug 204394 has been marked as a duplicate of this bug. ***


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