The following invalid code snippet triggers an ICE on mainline: =============================== template<typename T> struct A { __decltype (T* foo()); }; =============================== bug.cc:3: error: expected primary-expression before '*' token bug.cc:3: error: there are no arguments to 'foo' that depend on a template parameter, so a declaration of 'foo' must be available bug.cc:3: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) bug.cc:3: internal compiler error: Segmentation fault Please submit a full bug report, [etc.] The problem appeared between 2007-07-16 and 2007-08-15, presumably with the introduction of decltype: 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes. * cp-tree.def (DECLTYPE_TYPE): New. * error.c (dump_type): Dump DECLTYPE_TYPE nodes. ...
Same problem as in 33839; fixed by that patch. *** This bug has been marked as a duplicate of 33839 ***
While PR33839 and PR33837 got fixed, this ICE still persists.
Subject: Bug 33838 Author: dgregor Date: Wed Nov 7 23:37:29 2007 New Revision: 129975 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129975 Log: 2007-11-07 Douglas Gregor <doug.gregor@gmail.com> PR c++/33045 PR c++/33837 PR c++/33838 * semantics.c (finish_decltype_type): See through INDIRECT_REFs. Be careful with ERROR_MARK_NODEs. * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL argument. 2007-11-07 Douglas Gregor <doug.gregor@gmail.com> PR c++/33045 PR c++/33837 PR c++/33838 * g++.dg/cpp0x/decltype-33837.C: New. * g++.dg/cpp0x/decltype-refbug.C: New. * g++.dg/cpp0x/decltype-33838.C: New. Added: trunk/gcc/testsuite/g++.dg/cpp0x/decltype-33837.C trunk/gcc/testsuite/g++.dg/cpp0x/decltype-33838.C trunk/gcc/testsuite/g++.dg/cpp0x/decltype-refbug.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/cp/semantics.c trunk/gcc/testsuite/ChangeLog
Fixed