Bug 204395 - gcc segmentation fault when typename preceeds specified template
gcc segmentation fault when typename preceeds specified template
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
: 204394 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2006-08-28 16:50 EDT by Peter Tippett
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-29 04:32:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Peter Tippett 2006-08-28 16:50:39 EDT
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 04:32:59 EDT
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
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 04:36:18 EDT
*** 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.