Using gcc version 4.6.0 20110317 (svn revision 171087) on x86-64 Linux with the code struct foo { static void func (); }; void foo::func () const {}; and compile line "g++ -c test_static.cc" gives the following: test_static.cc:4:19: internal compiler error: in merge_types, at cp/typeck.c:825 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. The code is clearly invalid (g++ 4.5 indeed gives the following error message: "test_static.cc:4:19: error: static member function ‘void foo::func()’ declared with type qualifiers"), but g++ 4.6 returns with an ICE.
confirmed as a regression
Confirmed.
Caused by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159598
Author: jason Date: Thu Mar 17 16:02:08 2011 New Revision: 171103 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171103 Log: PR c++/48166 * decl.c (revert_static_member_fn): Strip function-cv-quals. Added: trunk/gcc/testsuite/g++.dg/parse/memfnquals1.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl.c trunk/gcc/testsuite/ChangeLog
GCC 4.6.0 is being released, adjusting target milestone.
Author: jason Date: Tue Mar 29 16:07:15 2011 New Revision: 171679 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171679 Log: PR c++/48166 * decl.c (revert_static_member_fn): Strip function-cv-quals. Added: branches/gcc-4_6-branch/gcc/testsuite/g++.dg/parse/memfnquals1.C Modified: branches/gcc-4_6-branch/gcc/cp/ChangeLog branches/gcc-4_6-branch/gcc/cp/decl.c branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Fixed for 4.6.1.