Bug 37649 - [4.4 regression] ICE with invalid template class
Summary: [4.4 regression] ICE with invalid template class
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Paolo Carlini
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2008-09-25 07:10 UTC by Volker Reichelt
Modified: 2008-09-25 20:41 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-09-25 10:05:39


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2008-09-25 07:10:41 UTC
The following invalid code snippet triggers an ICE on mainline:

==================================
struct A
{
  template<int> struct {};
};
==================================

bug.cc:3: error: template class without a name
bug.cc:3: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]

The regression was introduced between 2008-05-13 and 2008-06-21.
Comment 1 Paolo Carlini 2008-09-25 10:05:39 UTC
Can quickly fix this.
Comment 2 paolo@gcc.gnu.org 2008-09-25 20:39:55 UTC
Subject: Bug 37649

Author: paolo
Date: Thu Sep 25 20:38:32 2008
New Revision: 140670

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140670
Log:
/cp
2008-09-25  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/37649
	* name-lookup.c (maybe_process_template_type_declaration): Check
	return value of push_template_decl_real for error_mark_node.

/testsuite
2008-09-25  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/37649
	* g++.dg/template/crash82.C: New.


Added:
    trunk/gcc/testsuite/g++.dg/template/crash82.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/testsuite/ChangeLog

Comment 3 Paolo Carlini 2008-09-25 20:41:14 UTC
Fixed.
Comment 4 Paolo Carlini 2008-09-25 20:41:30 UTC
.