Skip to content

Instantly share code, notes, and snippets.

@cscheid
Last active December 12, 2015 08:39
Show Gist options
  • Save cscheid/4746185 to your computer and use it in GitHub Desktop.
Save cscheid/4746185 to your computer and use it in GitHub Desktop.
This crashes g++ 4.2.1 (the default OS X 10.8 compiler) with an ICE.
template <typename T>
void fun(T* obj) {}
template <typename T, void Fun(T*) = fun<T> >
struct S {
S(int m_sexp) {};
};
template <typename T>
S<T> ptr(int s) { return S<T>(s); }
void call(int s) {
S<int> p(ptr<int>(s));
}
/*
$ g++ crash.cpp
crash.cpp: In function ‘S<T, fun<T> > ptr(int) [with T = int]’:
crash.cpp:10: internal compiler error: Segmentation fault: 11
*/
@regehr
Copy link

regehr commented Feb 9, 2013

g++ trunk and also g++ on Ubuntu 12.10 don't crash either so I'm guessing this bug is dead

@regehr
Copy link

regehr commented Feb 9, 2013

can you post the file where c-reduce got stuck so we can work on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment