Bug 9229 - [3.4 regression] [New parser] ICE on illegal number of template parameters
Summary: [3.4 regression] [New parser] ICE on illegal number of template parameters
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2003-01-08 08:06 UTC by Wolfgang Bangerth
Modified: 2004-08-25 17:26 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bangerth 2003-01-08 08:06:02 UTC
This illegal code now provokes an ICE:
------------------------------
template <class T> class O {
    struct I;
    
    template <class T_>
    friend typename O<T_,void>::I f ();
};
template class O<int>;
-------------------------------

With 3.3 I got:
deal.II/base> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c c.cc
c.cc:5: error: wrong number of template arguments (2, should be 1)
c.cc:1: error: provided for `template<class T> class O'
c.cc:5: error: `I' is not a class or namespace
c.cc:5: error: ISO C++ forbids declaration of `f' with no type


While 3.4 now adds another ICE:
deal.II/base> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c c.cc
c.cc:5: error: wrong number of template arguments (2, should be 1)
c.cc:1: error: provided for `template<class T> class O'
c.cc:5: internal compiler error: tree check: expected class 't', have 'x' (
   error_mark) in make_typename_type, at cp/decl.c:5692
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

Since a proper message is given before, this is of low
priority.

W.

Release:
unknown

Environment:
3.4 after the new parser merge
Comment 1 Volker Reichelt 2003-01-15 01:28:17 UTC
State-Changed-From-To: open->closed
State-Changed-Why: Fixed in gcc 3.4-20030113.
    I now get
    
    PR9229.cc:5: error: wrong number of template arguments (2, should be 1)
    PR9229.cc:1: error: provided for `template<class T> class O'
    PR9229.cc:5: error: expected function-definition
    
    for the provided code snippets.
    
    (Testcase in preparation.)
Comment 2 Volker Reichelt 2003-02-06 22:34:55 UTC
From: reichelt@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9229
Date: 6 Feb 2003 22:34:55 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	reichelt@gcc.gnu.org	2003-02-06 22:34:55
 
 Modified files:
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/parse: fused-params1.C 
 	                            tmpl-tmpl-operator1.C 
 	                            non-dependent1.C dupl-tmpl-args1.C 
 	                            undefined7.C non-templ1.C 
 	                            too-many-tmpl-args1.C 
 
 Log message:
 	PR c++/8785
 	* g++.dg/parse/fused-params1.C: New test.
 	
 	PR c++/8857
 	* g++.dg/parse/tmpl-tmpl-operator1.C: New test.
 	
 	PR c++/8921
 	* g++.dg/parse/non-dependent1.C: New test.
 	
 	PR c++/8928
 	* g++.dg/parse/dupl-tmpl-args1.C: New test.
 	
 	PR c++/9228
 	* g++.dg/parse/undefined7.C: New test.
 	* g++.dg/parse/non-templ1.C: New test.
 	
 	PR c++/9229
 	* g++.dg/parse/too-many-tmpl-args1.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2399&r2=1.2400
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/fused-params1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/tmpl-tmpl-operator1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/non-dependent1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/dupl-tmpl-args1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/undefined7.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/non-templ1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/too-many-tmpl-args1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1