This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PR auto keyword variable lost its attributes/80986
- From: 林作健 <manjian2006 at gmail dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 2 Nov 2017 09:02:17 +0800
- Subject: [PATCH] PR auto keyword variable lost its attributes/80986
- Authentication-results: sourceware.org; auth=none
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,