http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52108
Bug #: 52108 Summary: declval() with incomplete type Classification: Unclassified Product: gcc Version: 4.5.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: hidden_p...@mail.ru Created attachment 26563 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26563 bug illustration Wrong report about 'incomplete type'. Situation has relation to type selection technique. Key string in the example is template <class T> static decltype( declval<typename T::pointer>(), declval<true_type>()) __test_p( int ); First declval (declval<typename T::pointer>) and comma operator required for problem demonstration. Another condition is usage of x-pair<int,Incomplete>. For testcase, see attached file. Compilation: c++ -std=gnu++0x -c test.cc