The following three lines of code: template <typename T> struct A; struct B { int f (); }; void g () { A<typeof(B::f)> a; } Result in an internal compiler error: Internal compiler error in walk_tree, at tree-inline.c:1315 Release: gcc version 3.2 (mingw special 20020817-1) Environment: Windows XP, gcc configure options: --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=f77,c++,objc,ada --disable-win32-registry --disable-shared How-To-Repeat: Compile the three lines of code (see problem description).
Fix: I don't have a clue..
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed.
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu> To: gcc-gnats@gcc.gnu.org Cc: Subject: Re: c++/8007: Internal compiler error in walk_tree Date: Fri, 1 Nov 2002 14:02:21 -0600 (CST) Whoever looks at this should also look at PRs 5750 and 4526. W. ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ticam.utexas.edu www: http://www.ticam.utexas.edu/~bangerth
From: Wolfgang Bangerth <bangerth@ices.utexas.edu> To: gcc-gnats@gcc.gnu.org Cc: Subject: Re: c++/8007 Date: Thu, 1 May 2003 14:34:04 -0500 (CDT) The ICE has been fixed between 3.2 and 3.2.3, as well as in 3.3 and 3.4. However, the code still doesn't compile. See also PR 10585. W. ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ices.utexas.edu www: http://www.ices.utexas.edu/~bangerth/
From: Wolfgang Bangerth <bangerth@ices.utexas.edu> To: gcc-gnats@gcc.gnu.org, Giovanni Bajo <giovannibajo@libero.it> Cc: Subject: Re: c++/8007 Date: Thu, 1 May 2003 15:51:40 -0500 (CDT) I don't know whether the code is legal (modulo the fact that typeof is an extension). It works if one uses typeof(&B::f), but not with typeof(B::f). Aren't there references to member functions? If not, shouldn't it just decay to a pointer-to-member-function? W. ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ices.utexas.edu www: http://www.ices.utexas.edu/~bangerth/
From: "Giovanni Bajo" <giovannibajo@libero.it> To: <gcc-gnats@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>, <nobody@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>, <sneechy@hotmail.com> Cc: Subject: Re: c++/8007: Internal compiler error in walk_tree Date: Thu, 1 May 2003 20:28:13 +0200 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8007 The ICE is now gone on both 3.3 and 3.4, and the code is rejected. The only reason why I keep this PR open is that I'm not sure if the code is legal or not. With GCC 2.95, A<> gets instantiated as A<int (B::)()>, which I am not sure it's a legal type. Can some GCC extension guru comment on this? Giovanni Bajo
Trunk gives: t.cc: In function 'void g()': t.cc:3: error: invalid use of non-static member function 'int B::f()' t.cc:3: error: template argument 1 is invalid t.cc:3: error: invalid type in declaration before ';' token
The error the trunk gives is correct; this is not one of the allowed uses of a member function name in [expr.prim]p10.