aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 44eed7e..33fb40a 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -14776,7 +14776,7 @@ cp_parser_declaration (cp_parser* parser, tree prefix_attrs)
}
}
- if (std_attrs != NULL_TREE)
+ if (std_attrs != NULL_TREE && !attribute_ignored_p (std_attrs))
warning_at (make_location (attrs_loc, attrs_loc, parser->lexer),
OPT_Wattributes, "attribute ignored");
if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON))
@@ -28979,7 +28979,9 @@ cp_parser_std_attribute (cp_parser *parser, tree attr_ns)
/* A GNU attribute that takes an identifier in parameter. */
attr_flag = id_attr;
- if (as == NULL)
+ /* If this is a fake attribute created to handle -Wno-attributes,
+ we must skip parsing the arguments. */
+ if (as == NULL || attribute_ignored_p (as))
{
if ((flag_openmp || flag_openmp_simd) && attr_ns == omp_identifier)
{