Bug 170394 - g++ segfaults when in certain situations I typed "," instead of "<"
Summary: g++ segfaults when in certain situations I typed "," instead of "<"
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc34
Version: 3
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-10-11 10:22 UTC by Tim Kroeger
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 3.4.5-2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-15 17:04:53 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Source file to reproduce the bug. (384 bytes, text/x-c++src)
2005-10-11 10:24 UTC, Tim Kroeger
no flags Details
Preprocessed source file produced by the compiler. (238.24 KB, application/octet-stream)
2005-10-11 10:25 UTC, Tim Kroeger
no flags Details

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



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