Bug 11070 - [3.4 regression] ICE in regenerate_decl_from_template after forgotten template for disambiguation
Summary: [3.4 regression] ICE in regenerate_decl_from_template after forgotten templat...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P1 critical
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, monitored
Depends on: 11071
Blocks: 10922
  Show dependency treegraph
 
Reported: 2003-06-02 22:53 UTC by Wolfgang Bangerth
Modified: 2004-01-17 04:22 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-07-05 23:24:14


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bangerth 2003-06-02 22:53:02 UTC
(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.
Comment 1 Wolfgang Bangerth 2003-06-02 22:54:56 UTC
Sorry, it was 10922, not 10992
Comment 2 Wolfgang Bangerth 2003-06-03 01:12:34 UTC
Basically the same bug, only in a worse setting, is also in PR 11071.
Whoever fixes one of them might as well fix both.
Comment 3 Giovanni Bajo 2003-06-03 17:19:50 UTC
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.
Comment 4 Wolfgang Bangerth 2003-06-03 19:43:30 UTC
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/


Comment 5 Andrew Pinski 2003-07-10 02:20:47 UTC
Fixed on the mainline (20030709) and it accepts the code also. I will submit a testcase 
when I get cvs access.
Comment 6 GCC Commits 2003-07-17 22:53:53 UTC
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

Comment 7 cvs-commit@developer.classpath.org 2006-03-20 20:03:16 UTC
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