This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PR auto keyword variable lost its attributes/80986


The following patch aims to removing the attribute only tf_waring flag is on.

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))
     warning (OPT_Wignored_attributes,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]