This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]