{ NULL, 0, 0, false, false, false, false, NULL, NULL }
};
-/* Return base name of the attribute. Ie '__attr__' is turned into 'attr'.
- To avoid need for copying, we simply return length of the string. */
-
-static void
-extract_attribute_substring (struct substring *str)
-{
- if (str->length > 4 && str->str[0] == '_' && str->str[1] == '_'
- && str->str[str->length - 1] == '_' && str->str[str->length - 2] == '_')
- {
- str->length -= 4;
- str->str += 2;
- }
-}
-
/* Insert an array of attributes ATTRIBUTES into a namespace. This
array must be NULL terminated. NS is the name of attribute
namespace. The function returns the namespace into which the
attr.str = IDENTIFIER_POINTER (name);
attr.length = IDENTIFIER_LENGTH (name);
- extract_attribute_substring (&attr);
return attrs->attribute_hash->find_with_hash (&attr,
substring_hash (attr.str,
attr.length));
tree attr_id
= get_identifier ((const char *)
cpp_token_as_text (pfile, nxt_token));
+ attr_id = canonicalize_attr_name (attr_id);
attr_name = build_tree_list (attr_ns, attr_id);
}
else
--- /dev/null
+/* PR c++/113674 */
+/* { dg-do compile { target { c || c++11 } } } */
+/* { dg-options "" } */
+
+[[____noreturn____]] int foo (int i) /* { dg-warning "'__noreturn__' attribute (directive )?ignored" } */
+{
+ return i;
+}
+
+[[____maybe_unused____]] int bar (int i) /* { dg-warning "'__maybe_unused__' attribute (directive )?ignored" } */
+{
+ return i;
+}