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.
Created attachment 119795 [details] Source file to reproduce the bug.
Created attachment 119796 [details] Preprocessed source file produced by the compiler. The compiler advised me to include this file in the bug report.
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