http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53498
Bug #: 53498 Summary: Compiler crashes during C++11 template magic compilation Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: o.mang...@googlemail.com I was trying to create some template magic to create a check for the existence of a function with variable number of arguments in C++11. Honestly, I don't know, if my code should compile through, as the problem happened when I was trying to figure out how to make it work. I got a compiler crash (which I guess shouldn't happen in any case). I cooked it down to the example below: > g++ -std=c++11 Crash.cxx g++: internal compiler error: Segmentation fault (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions. kiwi/SafePrintf$g++ -std=c++11 Crash.cxx g++: internal compiler error: Segmentation fault (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions. --- --- Crash.cxx --- template<typename... ARGS> class A { public: template<typename U> auto a(const U& u,const ARGS&... args,int) -> decltype(u.print(args...)) { } template<typename U> int a(const U& u,const ARGS&... args,...) { } }; template<typename... ARGS> class B { public: template<typename U> static void b(const U& u,const ARGS&... args, decltype(A<ARGS...>::a(u,args...,0)) dummy) { } }; int main() { B<int> dummy; return 0; }