diff mbox series

PR auto keyword variable lost its attributes/80986

Message ID CABdyAdHpQx_z5_95V=BR4Qu9zi7MsF3bcnfmn-OO7C1Ue3sdRw@mail.gmail.com
State New
Headers show
Series PR auto keyword variable lost its attributes/80986 | expand

Commit Message

林作健 Nov. 2, 2017, 1:02 a.m. UTC
The following patch aims to removing the attribute only tf_waring flag is on.

     warning (OPT_Wignored_attributes,
diff mbox series

Patch

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index d1c846ecf44..8ff46498fd6 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7410,7 +7410,10 @@  canonicalize_type_argument (tree arg,
tsubst_flags_t complain)
   if (!arg || arg == error_mark_node || arg == TYPE_CANONICAL (arg))
     return arg;
   bool removed_attributes = false;
-  tree canon = strip_typedefs (arg, &removed_attributes);
+  bool *premove_attributes = NULL;
+  if (complain & tf_warning)
+    premove_attributes = &removed_attributes;
+  tree canon = strip_typedefs (arg, premove_attributes);
   if (removed_attributes
       && (complain & tf_warning))