From e72028574f776fd5b73de8b974e4ea2d085f1532 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 15 Feb 2017 18:10:40 +0100 Subject: re PR c++/79301 (With -Werror=pedantic outside C++17 mode, __has_cpp_attribute(fallthrough) is nonzero but [[fallthrough]] fails) PR c++/79301 * parser.c (cp_parser_std_attribute): Don't pedwarn about [[deprecated]] with -std=c++11 and [[fallthrough]] with -std=c++11 and -std=c++14. * g++.dg/cpp1y/feat-cxx11-neg.C: Remove (with pedwarn) from [[deprecated]] comment. * g++.dg/cpp1y/feat-cxx98-neg.C: Likewise. * g++.dg/cpp1y/feat-cxx11.C: Likewise. * g++.dg/cpp1y/attr-deprecated-neg.C: Don't expect warnings for [[deprecated]] in -std=c++11. * g++.dg/cpp0x/fallthrough2.C: Don't expect warnings for [[fallthrough]] in -std=c++11 and -std=c++14. From-SVN: r245489 --- gcc/cp/parser.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'gcc/cp/parser.c') diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ccafefd..cd41ee6 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -24749,22 +24749,10 @@ cp_parser_std_attribute (cp_parser *parser, tree attr_ns) TREE_PURPOSE (TREE_PURPOSE (attribute)) = get_identifier ("gnu"); /* C++14 deprecated attribute is equivalent to GNU's. */ else if (is_attribute_p ("deprecated", attr_id)) - { - if (cxx_dialect == cxx11) - pedwarn (token->location, OPT_Wpedantic, - "% is a C++14 feature;" - " use %"); - TREE_PURPOSE (TREE_PURPOSE (attribute)) = get_identifier ("gnu"); - } + TREE_PURPOSE (TREE_PURPOSE (attribute)) = get_identifier ("gnu"); /* C++17 fallthrough attribute is equivalent to GNU's. */ else if (is_attribute_p ("fallthrough", attr_id)) - { - if (cxx_dialect < cxx1z) - pedwarn (token->location, OPT_Wpedantic, - "% is a C++17 feature;" - " use %"); - TREE_PURPOSE (TREE_PURPOSE (attribute)) = get_identifier ("gnu"); - } + TREE_PURPOSE (TREE_PURPOSE (attribute)) = get_identifier ("gnu"); /* Transactional Memory TS optimize_for_synchronized attribute is equivalent to GNU transaction_callable. */ else if (is_attribute_p ("optimize_for_synchronized", attr_id)) -- cgit v1.1