This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ Patch] PR 50660
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Sun, 09 Oct 2011 14:13:33 +0200
- Subject: [C++ Patch] PR 50660
Hi,
another duplicated diagnostic message. This one happens for snippets
like the below due to the temporary for the const ref:
int g(const int&);
int m2()
{
return g(__null);
}
50660.C:4:18: warning: passing NULL to non-pointer argument 1 of ‘int
g(const int&)’
50660.C:4:18: warning: passing NULL to non-pointer argument 1 of ‘int
g(const int&)’
I'm changing conversion_null_warnings to return true when a warning is
actually produced, which is checked by convert_like_real before calling
again itself recursively. I think it should be safe to shut down in that
case all kinds of further warnings, otherwise, we could even envisage
adding an issue_conversion_null_warnings parameter to convert_like_real,
as a last resort which certainly works.
Patch tested x86_64-linux.
Thanks,
Paolo.
/////////////////////
Attachment:
CL_50660
Description: Text document
Attachment:
patch_50660
Description: Text document