From Bugzilla Helper: User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.16-22 i686) Description of problem: gcc crashes with a segmentation fault when compiling the following. #include <iostream.h> template<class T, class U> class pair; class buffy { public: template<class T, class U> void send(pair<T,U> &victim) { cout << '(' << victim.lhs << ',' << victim.rhs << "\n"; }; }; template<class T, class U> class pair { private: T lhs; U rhs; public: pair(T x, U y): lhs(x), rhs(y) {}; friend void buffy::send<>(pair&); }; Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. call code above bug.cpp 2. g++ -c bug.cpp 3. Actual Results: randesk1% g++ -c gnubug.cpp gnubug.cpp:26: Internal error: Segmentation fault. Please submit a full bug report. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. Expected Results: Should have compiled cleanly. Does compile cleanly on IBM VisualAge v5. Gets clean bill of health from Parasoft CodeWizard 4.0 Additional info: randesk1% g++ -v -c gnubug.cpp Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85) /usr/lib/gcc-lib/i386-redhat-linux/2.96/cpp0 -lang-c++ -D__GNUG__=2 -D__E ONS -v -D__GNUC__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posi _NO_INLINE__ -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -D__tu 6__ gnubug.cpp /tmp/ccmlfIcO.ii GNU CPP version 2.96 20000731 (Red Hat Linux 7.1 2.96-85) (cpplib) (i386 L LF) ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/i386-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/include/g++-3 /usr/lib/gcc-lib/i386-redhat-linux/2.96/include /usr/include End of search list. /usr/lib/gcc-lib/i386-redhat-linux/2.96/cc1plus /tmp/ccmlfIcO.ii -quiet - se gnubug.cpp -version -o /tmp/ccQzNS8w.s GNU C++ version 2.96 20000731 (Red Hat Linux 7.1 2.96-85) (i386-redhat-lin mpiled by GNU C version 2.96 20000731 (Red Hat Linux 7.1 2.96-85). gnubug.cpp:26: Internal error: Segmentation fault. Please submit a full bug report. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. randesk1%
Still true in 3.2/8.0
Fixed in 3.3.