g++ reports segfault in cc1plus when attempting to compile code sample provided below: $ g++ -std=c++0x -o test test.cpp g++: Internal error: Segmentation fault (program cc1plus) Please submit a full bug report. See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions. $ g++ --version g++ (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ------ test.cpp ----------------------- # include <iostream> # include <vector> void print(const std::vector<int>& pack) { for(size_t i=0; i<pack.size(); i++) std::cout << pack[i] << " "; std::cout << "\n"; } template<typename ...Vals> void print(std::vector<int>& pack, int v1, Vals... vals) { pack.push_back(v1); print(pack, vals...); } template<typename ...Vals> void print(Vals... vals) { std::vector<int> pack; print(pack, vals...); } int main() { print(1); print("a"); // <-- this line triggers the failure print(2, 3, 4, 5); print(6, 7); }
I can't reproduce an ICE with FSF 4.4.3, 4.4.5, or 4.5/4.6 from svn, instead I get a diagnostic as expected because the code is invalid. Maybe you are hitting a bug in the Ubuntu package, in which case it should be reported to Ubuntu