aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien Chêne <fabien@gcc.gnu.org>2014-04-04 17:19:07 +0200
committerFabien Chêne <fabien@gcc.gnu.org>2014-04-04 17:19:07 +0200
commit3fe99aa5ce65c870729c680bdea7534f5bac0603 (patch)
treeea6a5b3100617659aac2a879f9416a751bc0abe6
parent610c8ef0a420e5267cbccd5a4509f0ce3095e14c (diff)
downloadgcc-3fe99aa5ce65c870729c680bdea7534f5bac0603.zip
gcc-3fe99aa5ce65c870729c680bdea7534f5bac0603.tar.gz
gcc-3fe99aa5ce65c870729c680bdea7534f5bac0603.tar.bz2
class.c (find_abi_tags_r): Check for the return of warning before emitting a note.
2014-04-04 Fabien Chêne <fabien@gcc.gnu.org> * class.c (find_abi_tags_r): Check for the return of warning before emitting a note. (one_inherited_ctor): Likewise. From-SVN: r209118
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/class.c28
2 files changed, 21 insertions, 13 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a575654..e095569 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
+ * class.c (find_abi_tags_r): Check for the return of warning
+ before emitting a note.
+ (one_inherited_ctor): Likewise.
+
+2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
+
* decl.c (duplicate_decls): Check for the return of permerror
before emitting a note.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 1dfcd91..9d6d126 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -1385,19 +1385,21 @@ find_abi_tags_r (tree *tp, int *walk_subtrees, void *data)
/* Otherwise we're diagnosing missing tags. */
else if (TYPE_P (p->subob))
{
- warning (OPT_Wabi_tag, "%qT does not have the %E abi tag "
- "that base %qT has", p->t, tag, p->subob);
- inform (location_of (p->subob), "%qT declared here",
- p->subob);
+ if (warning (OPT_Wabi_tag, "%qT does not have the %E abi tag "
+ "that base %qT has", p->t, tag, p->subob))
+ inform (location_of (p->subob), "%qT declared here",
+ p->subob);
}
else
{
- warning (OPT_Wabi_tag, "%qT does not have the %E abi tag "
- "that %qT (used in the type of %qD) has",
- p->t, tag, *tp, p->subob);
- inform (location_of (p->subob), "%qD declared here",
- p->subob);
- inform (location_of (*tp), "%qT declared here", *tp);
+ if (warning (OPT_Wabi_tag, "%qT does not have the %E abi tag "
+ "that %qT (used in the type of %qD) has",
+ p->t, tag, *tp, p->subob))
+ {
+ inform (location_of (p->subob), "%qD declared here",
+ p->subob);
+ inform (location_of (*tp), "%qT declared here", *tp);
+ }
}
}
}
@@ -3083,9 +3085,9 @@ one_inherited_ctor (tree ctor, tree t)
one_inheriting_sig (t, ctor, new_parms, i);
if (parms == NULL_TREE)
{
- warning (OPT_Winherited_variadic_ctor,
- "the ellipsis in %qD is not inherited", ctor);
- inform (DECL_SOURCE_LOCATION (ctor), "%qD declared here", ctor);
+ if (warning (OPT_Winherited_variadic_ctor,
+ "the ellipsis in %qD is not inherited", ctor))
+ inform (DECL_SOURCE_LOCATION (ctor), "%qD declared here", ctor);
}
}