re PR c++/28387 (ICE with attribute on invalid declaration)

PR c++/28387
	* decl2.c (cplus_decl_attributes): Check for invalid decls.

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

From-SVN: r115465
This commit is contained in:
Volker Reichelt 2006-07-15 09:22:17 +00:00 committed by Volker Reichelt
parent 72aeff7c56
commit 6ae9b8759e
4 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2006-07-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28387
* decl2.c (cplus_decl_attributes): Check for invalid decls.
2006-07-14 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28343

View File

@ -997,7 +997,8 @@ grokbitfield (const cp_declarator *declarator,
void
cplus_decl_attributes (tree *decl, tree attributes, int flags)
{
if (*decl == NULL_TREE || *decl == void_type_node)
if (*decl == NULL_TREE || *decl == void_type_node
|| *decl == error_mark_node)
return;
if (TREE_CODE (*decl) == TEMPLATE_DECL)

View File

@ -1,3 +1,8 @@
2006-07-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28387
* g++.dg/ext/attrib24.C: New test.
2006-07-14 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28343

View File

@ -0,0 +1,4 @@
// PR c++/28387
// { dg-do compile }
enum __attribute__((unused)) E; // { dg-error "without previous declaration" }