http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52830
Bug #: 52830 Summary: ICE: "canonical types differ for identity types ..." when attempting SFINAE with member type Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: lucdan...@free.fr Created attachment 27061 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27061 Testcase Using $ gcc-snapshot --version gcc-snapshot (Debian 20120313-1) 4.8.0 20120313 (experimental) [trunk revision 185345] I get the following when attempting to compile what I believe to be a correct testcase program (although I could be wrong on correctness): main.cpp:25:21: internal compiler error: canonical types differ for identical types std::enable_if<std::is_same<typename foo<T>::type, U>::value, int> and std::enable_if<std::is_same<T, U>::value, int> The program compiles and behaves as expected if T is used instead of type/typename foo<T>::type in both declaration and definition, or if bar is defined inline.