Last active
December 12, 2015 08:39
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
*/ |
Ubuntu 12.04.1 (g++ 4.6.3) doesn't crash.
g++ trunk and also g++ on Ubuntu 12.10 don't crash either so I'm guessing this bug is dead
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
Crashes Ubuntu 10.04.4 (I know, I know), and its g++ 4.4.3 as well, with