The following code snippet causes an ICE since GCC 3.4.0: ================================== struct A { template<int> void* foo(; }; ================================== bug.cc:3: error: expected primary-expression before ';' token bug.cc:3: error: ISO C++ forbids initialization of member 'foo' bug.cc:3: error: making 'foo' static bug.cc:3: error: invalid in-class initialization of static data member of non-integral type 'void*' bug.cc:3: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'void_type' in cp_finish_decl, at cp/decl.c:5027 Please submit a full bug report, [etc.]
Confirmed.
Subject: Bug number PR c++/27398 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-05/msg00943.html
Subject: Bug 27398 Author: reichelt Date: Sun May 21 08:39:14 2006 New Revision: 113950 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113950 Log: PR c++/27398 * decl.c (grokdeclarator): Return error_mark_node instead of NULL_TREE or void_type_node. * g++.dg/template/crash50.C: New test. Added: trunk/gcc/testsuite/g++.dg/template/crash50.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl.c trunk/gcc/testsuite/ChangeLog
Fixed on mainline.
Subject: Bug number PR c++/27398 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00075.html
Backporting the patch to the branches was considered to risky, see http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00804.html So closing as fixed on mainline.