re PR c++/52906 (ICE: SIGSEGV in check_tag_decl (decl.c:4230) with "__attribute__ ((__deprecated__));" alone)

PR c++/52906
	* decl.c (check_tag_decl): Don't complain about attributes if we
	don't even have a type.

From-SVN: r186435
This commit is contained in:
Jason Merrill 2012-04-13 15:44:15 -04:00 committed by Jason Merrill
parent c7dbd7af46
commit c7b071838f
4 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2012-04-11 Jason Merrill <jason@redhat.com>
PR c++/52906
* decl.c (check_tag_decl): Don't complain about attributes if we
don't even have a type.
2012-04-05 Jason Merrill <jason@redhat.com>
PR c++/52596

View File

@ -4216,7 +4216,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
error ("%<constexpr%> cannot be used for type declarations");
}
if (declspecs->attributes)
if (declspecs->attributes && declared_type)
{
location_t loc = input_location;
if (!CLASS_TYPE_P (declared_type)

View File

@ -1,3 +1,8 @@
2012-04-11 Jason Merrill <jason@redhat.com>
PR c++/52906
* g++.dg/ext/attrib45.C: New.
2012-04-13 Tom de Vries <tom@codesourcery.com>
Backport from mainline r186419.

View File

@ -0,0 +1,3 @@
// PR c++/52906
__attribute__ ((__deprecated__)); // { dg-error "does not declare anything" }