* pt.c (tsubst_attributes): Fix loop logic.
From-SVN: r238392
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.
}
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;
--- /dev/null
+// 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);