(This is the ICE-on-mainline from 10992) This ICEs on mainline: -------------------------------- template <bool b> struct X { template <typename T> static int* execute(int* x) { return x; } }; template <typename T> void foo() { static bool const same = true; X<same>::execute<int> (0); } template void foo<int> (); --------------------------------------------------- g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c y.cc y.cc: In static member function `static int* X::execute(int*)': y.cc:3: instantiated from `static int* X<b>::execute(int*) [with T = int, bool b = same]' y.cc:8: instantiated from `void foo() [with T = int]' y.cc:11: instantiated from here y.cc:3: internal compiler error: in regenerate_decl_from_template, at cp/pt.c: 10691 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. g/x> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c y.cc y.cc: In function `void foo()': y.cc:8: error: parse error before `>' token Thus, 3.3 gives the right clue: we're missing the "template" keyword for disambiguation, but the ICE at an unrelated place is not helpful in finding it. W.
Sorry, it was 10922, not 10992
Basically the same bug, only in a worse setting, is also in PR 11071. Whoever fixes one of them might as well fix both.
You don't need the explicit template keyword anyway because the postfix- expression which names the template-id (X<same>::execute) does not depend on the template parameter T of foo. The code is indeed legal as-is. Notice that this very problem is already covered by c++/8222 ("keyword 'template' required to access member templates in non-dependent postfix expressions"), so you probably want to close either 11070 or 11071.
Subject: Re: [3.4 regression] ICE in regenerate_decl_from_template after forgotten template for disambiguation > Notice that this very problem is already covered by c++/8222 > ("keyword 'template' required to access member templates in non-dependent > postfix expressions"), so you probably want to close either 11070 or 11071. Not quite, because these two ICE whereas 8222 doesn't. W. ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ices.utexas.edu www: http://www.ices.utexas.edu/~bangerth/
Fixed on the mainline (20030709) and it accepts the code also. I will submit a testcase when I get cvs access.
Subject: Bug 11070 CVSROOT: /cvs/gcc Module name: gcc Changes by: pinskia@gcc.gnu.org 2003-07-17 22:53:47 Modified files: gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/expr: crash-1.C gcc/testsuite/g++.dg/template: init3.C non-dependent1.C non-dependent2.C non-dependent3.C sizeof5.C Log message: Andrew Pinski <pinskia@physics.uc.edu> PR c++/10476 * g++.dg/expr/crash-1.C: New test. PR c++/11027 * g++.dg/template/init3.C: New test. PR c++/8222 * g++.dg/template/non-dependent1.C: New test. PR c++/11070 * g++.dg/template/non-dependent2.C: New test. PR c++/11071 * g++.dg/template/non-dependent3.C: New test. PR c++/9907 * g++.dg/template/sizeof5.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2892&r2=1.2893 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/expr/crash-1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/init3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/non-dependent1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/non-dependent2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/non-dependent3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/sizeof5.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 11070 CVSROOT: /cvsroot/classpath Module name: classpath Branch: Changes by: Chris Burdess <dog@savannah.gnu.org> 06/03/20 19:54:35 Modified files: . : ChangeLog gnu/xml/stream : XMLParser.java Log message: 2006-03-20 Chris Burdess <dog@gnu.org> Fixes PR 11070 * gnu/xml/stream/XMLParser.java: Permit U+fffd as XML Char. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6830&tr2=1.6831&r1=text&r2=text http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/xml/stream/XMLParser.java.diff?tr1=1.27&tr2=1.28&r1=text&r2=text