[C++ Patch] PR 50660
Paolo Carlini
paolo.carlini@oracle.com
Sun Oct 9 13:31:00 GMT 2011
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.
/////////////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_50660
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111009/2c6e9ef8/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_50660
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111009/2c6e9ef8/attachment-0001.ksh>
More information about the Gcc-patches
mailing list