Bug 170394 - g++ segfaults when in certain situations I typed "," instead of "<"
g++ segfaults when in certain situations I typed "," instead of "<"
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: gcc34 (Show other bugs)
3
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-11 06:22 EDT by Tim Kroeger
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 3.4.5-2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-15 12:04:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Tim Kroeger 2005-10-11 06:22:39 EDT
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 06:24:02 EDT
Created attachment 119795 [details]
Source file to reproduce the bug.
Comment 2 Tim Kroeger 2005-10-11 06:25:37 EDT
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 12:04:53 EST
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.