summaryrefslogtreecommitdiffstats
path: root/gcc/cp
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-15 18:24:31 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-15 18:24:31 +0000
commitbe6494a83fcd4889680352d98c5b76ce0c1680b3 (patch)
tree78e0db04f507a690e13498e747a92dc48ea8231b /gcc/cp
parentc27c28571f5dcd06cf32f4f539ac5747cdafd33e (diff)
downloadppe42-gcc-be6494a83fcd4889680352d98c5b76ce0c1680b3.tar.gz
ppe42-gcc-be6494a83fcd4889680352d98c5b76ce0c1680b3.zip
/cp
2013-05-15 Paolo Carlini <paolo.carlini@oracle.com> * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of warning_at and permerror with warning_at/inform and permerror/ inform, respectively. /testsuite 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/cpp0x/lambda/lambda-shadow1.C: Replace dg-warnings with dg-messages. * g++.dg/warn/Wshadow-1.C: Likewise. * g++.dg/warn/Wshadow-6.C: Likewise. * g++.dg/warn/Wshadow-7.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198943 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/name-lookup.c29
2 files changed, 24 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index cf91769b72f..a602af3addb 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
+ * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
+ warning_at and permerror with warning_at/inform and permerror/
+ inform, respectively.
+
+2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
+
PR c++/31952
* name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
redeclarations.
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index a60504fafdf..17d5ca26516 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -943,8 +943,10 @@ pushdecl_maybe_friend_1 (tree x, bool is_friend)
&& TREE_CODE (decl) == TREE_CODE (x)
&& !same_type_p (TREE_TYPE (x), TREE_TYPE (decl)))
{
- permerror (input_location, "type mismatch with previous external decl of %q#D", x);
- permerror (input_location, "previous external decl of %q+#D", decl);
+ if (permerror (input_location, "type mismatch with previous "
+ "external decl of %q#D", x))
+ inform (input_location, "previous external decl of %q+#D",
+ decl);
}
}
@@ -1161,19 +1163,23 @@ pushdecl_maybe_friend_1 (tree x, bool is_friend)
if (warn_shadow && !nowarn)
{
+ bool warned;
+
if (TREE_CODE (oldlocal) == PARM_DECL)
- warning_at (input_location, OPT_Wshadow,
+ warned = warning_at (input_location, OPT_Wshadow,
"declaration of %q#D shadows a parameter", x);
else if (is_capture_proxy (oldlocal))
- warning_at (input_location, OPT_Wshadow,
+ warned = warning_at (input_location, OPT_Wshadow,
"declaration of %qD shadows a lambda capture",
x);
else
- warning_at (input_location, OPT_Wshadow,
+ warned = warning_at (input_location, OPT_Wshadow,
"declaration of %qD shadows a previous local",
x);
- warning_at (DECL_SOURCE_LOCATION (oldlocal), OPT_Wshadow,
- "shadowed declaration is here");
+
+ if (warned)
+ inform (DECL_SOURCE_LOCATION (oldlocal),
+ "shadowed declaration is here");
}
}
@@ -1213,10 +1219,11 @@ pushdecl_maybe_friend_1 (tree x, bool is_friend)
|| TREE_CODE (x) == TYPE_DECL))))
/* XXX shadow warnings in outer-more namespaces */
{
- warning_at (input_location, OPT_Wshadow,
- "declaration of %qD shadows a global declaration", x);
- warning_at (DECL_SOURCE_LOCATION (oldglobal), OPT_Wshadow,
- "shadowed declaration is here");
+ if (warning_at (input_location, OPT_Wshadow,
+ "declaration of %qD shadows a "
+ "global declaration", x))
+ inform (DECL_SOURCE_LOCATION (oldglobal),
+ "shadowed declaration is here");
}
}
}
OpenPOWER on IntegriCloud