PR c++/85062 - ICE with alignas in wrong place.

* decl.c (grokdeclarator): Ignore attributes on type-specifiers
	here.

From-SVN: r258859
This commit is contained in:
Jason Merrill 2018-03-26 12:30:41 -04:00 committed by Jason Merrill
parent ddd5c5b7c6
commit 125c297c69
3 changed files with 17 additions and 4 deletions

View file

@ -1,5 +1,9 @@
2018-03-26 Jason Merrill <jason@redhat.com>
PR c++/85062 - ICE with alignas in wrong place.
* decl.c (grokdeclarator): Ignore attributes on type-specifiers
here.
PR c++/85049 - ICE with __integer_pack.
* pt.c (unify_pack_expansion): Don't try to deduce generated packs.
* cp-tree.h (TEMPLATE_PARM_P): New.

View file

@ -10946,10 +10946,10 @@ grokdeclarator (const cp_declarator *declarator,
if (declspecs->std_attributes)
{
/* Apply the c++11 attributes to the type preceding them. */
input_location = declspecs->locations[ds_std_attribute];
decl_attributes (&type, declspecs->std_attributes, 0);
input_location = saved_loc;
location_t attr_loc = declspecs->locations[ds_std_attribute];
if (warning_at (attr_loc, OPT_Wattributes, "attribute ignored"))
inform (attr_loc, "an attribute that appertains to a type-specifier "
"is ignored");
}
/* Determine the type of the entity declared by recurring on the

View file

@ -0,0 +1,9 @@
// PR c++/85062
// { dg-do compile { target c++11 } }
template<typename... T> struct A
{
int alignas(T...) i; // { dg-warning "ignored" }
};
A<int> a;