http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50870
Bug #: 50870 Summary: [C++0x] ICE with decltype, operator->, and default template arguments Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: daniel.krueg...@googlemail.com CC: ja...@redhat.com This is a follow-up of bug 50864. gcc 4.7.0 20111022 (experimental) with compiler option -std=c++0x -Wall (with or without -pedantic) causes an ICE for the following code //--- struct impl { template <class T> static T create(); }; #define USE_CLASS #ifdef USE_CLASS template<class T, class U, class = decltype(impl::create<T>()->impl::create<U>()) // line 9 > struct tester{}; tester<impl*, int> ti; #else template<class T, class U, class = decltype(impl::create<T>()->impl::create<U>()) // line 16 > int test() { return 0; } int i = test<impl*, int>(); #endif //--- If USE_CLASS is defined: "main.cpp|9|internal compiler error: Segmentation fault" otherwise: "main.cpp|16|internal compiler error: Segmentation fault" Both code branches should be accepted.