Commit 1019d191 by Jason Merrill Committed by Jason Merrill

PR c++/71513 - alignas on member enum in template

	* pt.c (tsubst_attributes): Fix loop logic.

From-SVN: r238392
parent 37a92c0c
2016-07-15 Jason Merrill <jason@redhat.com>
PR c++/71513
* pt.c (tsubst_attributes): Fix loop logic.
PR c++/71604
PR c++/54430
* parser.c (cp_parser_range_for): Modify IDENTIFIER_BINDING directly.
......
......@@ -9713,20 +9713,23 @@ tsubst_attributes (tree attributes, tree args,
}
if (last_dep)
for (tree *p = &attributes; *p; p = &TREE_CHAIN (*p))
for (tree *p = &attributes; *p; )
{
tree t = *p;
if (ATTR_IS_DEPENDENT (t))
{
tree subst = tsubst_attribute (t, NULL, args, complain, in_decl);
if (subst == t)
continue;
*p = subst;
do
p = &TREE_CHAIN (*p);
while (*p);
*p = TREE_CHAIN (t);
if (subst != t)
{
*p = subst;
do
p = &TREE_CHAIN (*p);
while (*p);
*p = TREE_CHAIN (t);
continue;
}
}
p = &TREE_CHAIN (*p);
}
return attributes;
......
// PR c++/71513
// { dg-do compile { target c++11 } }
template < int N, typename T >
struct A
{
enum alignas (N) E : T;
};
#define SA(X) static_assert((X), #X)
constexpr int al = alignof(double);
SA(alignof(A<al,char>::E) == al);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment