Bug 16716 - [4.0 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
Summary: [4.0 regression] ICE in cp_parser_parse_and_diagnose_invalid_type_name
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Mark Mitchell
URL:
Keywords: ice-on-invalid-code, monitored
Depends on: 14667
Blocks:
  Show dependency treegraph
 
Reported: 2004-07-26 14:59 UTC by Wolfgang Bangerth
Modified: 2004-09-14 00:33 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.3.3 3.4.1
Known to fail:
Last reconfirmed: 2004-07-26 15:08:48


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bangerth 2004-07-26 14:59:54 UTC
Take this (invalid, the "typename" shouldn't be there) piece of code: 
------------------- 
template <typename> class allocator; 
 
template<typename T> class vector { 
    typedef typename allocator<T> allocator_type; 
}; 
------------------ 
 
g/x> /home/bangerth/bin/gcc-3.2.3/bin/c++ -c x.cc 
x.cc:4: syntax error before `;' token 
 
g/x> /home/bangerth/bin/gcc-3.3*/bin/c++ -c x.cc 
x.cc:4: error: parse error before `;' token 
 
g/x> /home/bangerth/bin/gcc-3.4*/bin/c++ -c x.cc 
x.cc:4: error: expected nested-name-specifier 
x.cc:4: error: `allocator<T>' specified as declarator-id 
x.cc:4: error: two or more data types in declaration of `allocator<T>' 
x.cc:4: error: expected `;' before "allocator_type" 
 
g/x> /home/bangerth/bin/gcc-3.5*/bin/c++ -c x.cc 
x.cc:4: error: expected nested-name-specifier 
x.cc:4: internal compiler error: in 
cp_parser_parse_and_diagnose_invalid_type_name, at cp/parser.c:2268 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
That's a regression. 
 
W.
Comment 1 Andrew Pinski 2004-07-26 15:08:48 UTC
: Search converges between 2004-02-01-trunk (#445) and 2004-03-01-trunk (#446).

Most likely the same as PR 14667.
Comment 2 Mark Mitchell 2004-09-09 04:38:06 UTC
Mine
Comment 3 GCC Commits 2004-09-14 00:29:08 UTC
Subject: Bug 16716

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-09-14 00:29:04

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/cp         : ChangeLog parser.c pt.c 
Added files:
	gcc/testsuite/g++.dg/parse: crash17.C 
	gcc/testsuite/g++.dg/template: enum3.C 

Log message:
	PR c++/16716
	* parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
	Robustify.
	
	PR c++/17327
	* pt.c (unify): Add ENUMERAL_TYPE case.  Replace sorry with
	gcc_unreacable.
	
	PR c++/16716
	* g++.dg/parse/crash17.C: New test.
	
	PR c++/17327
	* g++.dg/template/enum3.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4279&r2=1.4280
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4348&r2=1.4349
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.245&r2=1.246
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.921&r2=1.922
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash17.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/enum3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 4 Mark Mitchell 2004-09-14 00:33:10 UTC
Fixed in GCC 4.0.