retitle 176101 [fixed in 3.4] broken c++ code causes g++-3.2 and older to segfault thanks
$ /usr/lib/gcc-experimental/bin/g++ -c bug-176101.cc bug-176101.cc:10: warning: all member functions in class `A<T3>' are private bug-176101.cc: In member function `void A<T3>::f()': bug-176101.cc:14: error: expected `(' bug-176101.cc:14: error: expected primary-expression Martin Bayer writes: > Subject: g++-3.2: broken c++ code causes g++-3.2 and older to segfault > Package: g++-3.2 > Version: 1:3.2.2-0pre3 > Severity: normal > Tags: upstream > > The following (broken!) code causes the g++-3.2 to segfault. The behaviour > happens with older versions of the gcc too. > > =================================== > =bugcode.cpp > =================================== > template<typename T1> > class map > { > public: > typedef T1 iterator; > }; > > template<typename T3> > class A > { > typedef map<T3> B; > void f() > { > typename B::iterator<T3> it; > } > }; > ==================================== > > compiling it with: > > g++-3.2 -c gccbug.cpp > results in > ========================================================================= > gccbug.cpp:10: warning: all member functions in class `A<T3>' are private > gccbug.cpp: In member function `void A<T3>::f()': > gccbug.cpp:14: internal error: Segmentation fault > Please submit a full bug report, > with preprocessed source if appropriate. > See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions. > =========================================================================