+2018-10-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/86288
+ * parser.c (cp_parser_std_attribute): Canonicalize attr_ns, and when
+ :: is not present and attr_ns non-NULL, canonicalize also attr_id.
+ (cp_parser_attribute_spec): Fix comment typo.
+
2018-10-24 Martin Sebor <msebor@redhat.com>
PR c++/84851
return error_mark_node;
}
+ attr_ns = canonicalize_attr_name (attr_ns);
attr_id = canonicalize_attr_name (attr_id);
attribute = build_tree_list (build_tree_list (attr_ns, attr_id),
NULL_TREE);
token = cp_lexer_peek_token (parser->lexer);
}
else if (attr_ns)
- attribute = build_tree_list (build_tree_list (attr_ns, attr_id),
- NULL_TREE);
+ {
+ attr_ns = canonicalize_attr_name (attr_ns);
+ attr_id = canonicalize_attr_name (attr_id);
+ attribute = build_tree_list (build_tree_list (attr_ns, attr_id),
+ NULL_TREE);
+ }
else
{
attr_id = canonicalize_attr_name (attr_id);
|| !cp_parser_require (parser, CPP_CLOSE_SQUARE, RT_CLOSE_SQUARE))
cp_parser_skip_to_end_of_statement (parser);
else
- /* Warn about parsing c++11 attribute in non-c++1 mode, only
+ /* Warn about parsing c++11 attribute in non-c++11 mode, only
when we are sure that we have actually parsed them. */
maybe_warn_cpp0x (CPP0X_ATTRIBUTES);
}
--- /dev/null
+// PR c++/86288
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wattributes" }
+
+int a [[gnu::aligned(alignof(int))]];
+int b [[gnu::__aligned__(alignof(int))]];
+int c [[__gnu__::aligned(alignof(int))]];
+int d [[__gnu__::__aligned__(alignof(int))]];
+int e [[using gnu : aligned(alignof(int))]]; // { dg-warning "attribute using prefix only available" "" { target c++14_down } }
+int f [[using gnu : __aligned__(alignof(int))]]; // { dg-warning "attribute using prefix only available" "" { target c++14_down } }
+int g [[using __gnu__ : aligned(alignof(int))]]; // { dg-warning "attribute using prefix only available" "" { target c++14_down } }
+int h [[using __gnu__ : __aligned__(alignof(int))]]; // { dg-warning "attribute using prefix only available" "" { target c++14_down } }