http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51884
Bug #: 51884 Summary: ICE with c++11 thread and templates Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: bluesca...@gmail.com Created attachment 26354 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26354 Code snippet demonstrating the issue. The attached minimal code snippet causes an ICE on g++-4.5.3, g++-4.6.2 and g++-4.7.0-alpha20111231. The compilation command is: g++ -std=c++0x bug.cpp The output on 4.5: In file included from bug.cpp:1:0: /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/thread:112:7: internal compiler error: in dfs_walk_once, at cp/search.c:1645 The output on 4.6: In file included from bug.cpp:1:0: /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4/thread:109:14: internal compiler error: in dfs_walk_once, at cp/search.c:1659 The output on 4.7: ‘ In file included from bug.cpp:1:0: in dfs_walk_once, at cp/search.c:1695 The ICE is avoided at least in these cases: - replace the method bar() with a non-templated version, - replace the std::enable_if<...> enabler with void.