Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 104115

Summary: g++ 3.4.3 segmentation fault
Product: Gentoo Linux Reporter: ville <vzheiska>
Component: [OLD] Core systemAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
URL: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23797
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Preprocessed source

Description ville 2005-08-29 04:04:14 UTC
g++ (GCC) 3.4.3-20050110 (Gentoo 3.4.3.20050110-r2, ssp-3.4.3.20050110-0,
pie-8.7.7) is unable to report that the code is invalid and crashes instead.


Reproducible: Always
Steps to Reproduce:
1. test.cpp:
#include <iostream>
#include <ostream>

template <int> struct foo;

template<>
struct foo<0> {
  typedef int t;
};

int main() {
  std::cout<< typename foo<0>::t(42);
} 

2. g++ test.cpp -o test

Actual Results:  
src/main.cpp: In function `int main()':
src/main.cpp:14: internal compiler error: Segmentation fault


Expected Results:  
The g++ should've reported that it isn't valid C++.
Comment 1 ville 2005-08-29 04:06:11 UTC
Created attachment 67157 [details]
Preprocessed source
Comment 2 Mark Loeser (RETIRED) gentoo-dev 2005-12-12 07:21:32 UTC
3.4.5 handles this error correctly.  I'll make sure the patch applies cleanly to
3.4.4 later and throw it into CVS for the next patchset.
Comment 3 Mark Loeser (RETIRED) gentoo-dev 2005-12-22 01:01:45 UTC
The patch applies cleanly, but wrongly accepts the code.  3.4.5 and above are fixed for this issue though.