Bug 28387 - [4.2 regression] ICE with attribute on invalid declaration
Summary: [4.2 regression] ICE with attribute on invalid declaration
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.2.0
Assignee: Volker Reichelt
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2006-07-14 20:30 UTC by Volker Reichelt
Modified: 2006-07-15 10:08 UTC (History)
1 user (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 Volker Reichelt 2006-07-14 20:30:26 UTC
Mainline's C++ frontend ICEs on the following code:

=======================================
enum __attribute__((unused)) E;
=======================================

bug.cc:1: error: use of enum 'E' without previous declaration
bug.cc:1: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in decl_attributes, at attribs.c:281
Please submit a full bug report, [etc.]

Posting a patch soon.
Comment 1 patchapp@dberlin.org 2006-07-14 20:35:11 UTC
Subject: Bug number PR c++/28387

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00648.html
Comment 2 Volker Reichelt 2006-07-15 09:22:27 UTC
Subject: Bug 28387

Author: reichelt
Date: Sat Jul 15 09:22:17 2006
New Revision: 115465

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115465
Log:
	PR c++/28387
	* decl2.c (cplus_decl_attributes): Check for invalid decls.

	* g++.dg/ext/attrib24.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/ext/attrib24.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl2.c
    trunk/gcc/testsuite/ChangeLog

Comment 3 Volker Reichelt 2006-07-15 10:08:03 UTC
Fixed on mainline.