Bug 170394

Summary: g++ segfaults when in certain situations I typed "," instead of "<"
Product: [Fedora] Fedora Reporter: Tim Kroeger <tim>
Component: gcc34Assignee: Jakub Jelinek <jakub>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: 3.4.5-2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-03-15 17:04:53 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:
Attachments:
Description Flags
Source file to reproduce the bug.
none
Preprocessed source file produced by the compiler. none

Description Tim Kroeger 2005-10-11 10:22:39 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.0.4-1.3.1 Firefox/1.0.4

Description of problem:
I use the STL container "list" with a template argument that is itself a template class.  When using an iterator, I accidentally typed

std::list<A,int>*>::iterator

instead of

std::list<A<int>*>::iterator

(the difference being that I typed a "," instead of a "<").

g++ b.cpp -o b -Wall -O3

produces a segfault.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Run the command "g++ b.cpp -o b -Wall -O3" on the attached file.


Actual Results:  The compiler segfaulted and advised to write a bug report.  That's why I'm doing this.

Expected Results:  The compiler should send an error message, either because list may not take two template arguments or because the second ">" doesn't make sense.

Additional info:

Output is as follows (sorry for the partially German g++ output)

b.cpp: In member function `void A<R>::do_something()':
b.cpp:14: interner Compiler-Fehler: Speicherzugriffsfehler
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccUvEIfF.out file, please attach this to your bugreport.

Comment 1 Tim Kroeger 2005-10-11 10:24:02 UTC
Created attachment 119795 [details]
Source file to reproduce the bug.

Comment 2 Tim Kroeger 2005-10-11 10:25:37 UTC
Created attachment 119796 [details]
Preprocessed source file produced by the compiler.

The compiler advised me to include this file in the bug report.

Comment 3 Jakub Jelinek 2006-03-15 17:04:53 UTC
Works fine with gcc 3.4.5-2 (RHEL4 U3) and newer FC GCCs (4.0.x and 4.1.x).
rpm -q gcc-c++; g++ -O3 -Wall 170394.ii ; echo $?
gcc-c++-3.4.5-2
b.cpp: In member function `void A<R>::do_something()':
b.cpp:14: error: expected unqualified-id before '>' token
b.cpp:14: error: expected initializer before '>' token
1