This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] c++: annotate warnings
- From: Dirk Mueller <dmueller at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 9 Feb 2007 12:23:16 +0100
- Subject: [PATCH] c++: annotate warnings
Hi,
bootstrapped, regtested, no additional regressions (i686-suse-linux)
2007-02-09 Dirk Mueller <dmueller@suse.de>
* friend.c (do_friend): Annotate warning about friend
declarations in templates with OPT_Wnon_template_friend.
Convert informal message from warning() to inform().
Index: cp/friend.c
===================================================================
--- cp/friend.c (revision 121595)
+++ cp/friend.c (working copy)
@@ -548,14 +548,13 @@ do_friend (tree ctype, tree declarator,
if (warn)
{
static int explained;
- warning (0, "friend declaration %q#D declares a non-template "
- "function", decl);
+ warning (OPT_Wnon_template_friend, "friend declaration "
+ "%q#D declares a non-template function", decl);
if (! explained)
{
- warning (0, "(if this is not what you intended, make sure "
- "the function template has already been declared "
- "and add <> after the function name here) "
- "-Wno-non-template-friend disables this warning");
+ inform ("(if this is not what you intended, make sure "
+ "the function template has already been declared "
+ "and add <> after the function name here) ");
explained = 1;
}
}