[Bug c++/111281] unhelpful warning output ('nonnull' argument 'v' compared to NULL)

2023-09-05 Thread f.heckenbach--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111281 --- Comment #8 from Frank Heckenbach --- I don't suggest to get rid of the warning. As I said in #3, if it's hard to track, a more inclusive wording seems fine to me. But my main grief about this message is the lack of context, i.e. the really

[Bug c++/111281] unhelpful warning output ('nonnull' argument 'v' compared to NULL)

2023-09-05 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111281 --- Comment #7 from Jonathan Wakely --- The warning comes from the middle end, where the context of the conversion to bool might have been lost. But the C++ front end already suppresses those warnings in several places: /* This is a compiler

[Bug c++/111281] unhelpful warning output ('nonnull' argument 'v' compared to NULL)

2023-09-05 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111281 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug c++/111281] unhelpful warning output ('nonnull' argument 'v' compared to NULL)

2023-09-05 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111281 --- Comment #5 from Jonathan Wakely --- (In reply to Frank Heckenbach from comment #4) > template concept IsFunction = std::is_function_v || > (std::is_pointer_v && std::is_function_v >); remove_pointer is a no-op for non-pointers so you'll

[Bug c++/111281] unhelpful warning output ('nonnull' argument 'v' compared to NULL)

2023-09-05 Thread f.heckenbach--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111281 --- Comment #4 from Frank Heckenbach --- FWIW, as stated, the lack of context in the message made it hard to find the actual location of the bug in my code -- in the end even harder than I had expected since it was well hidden. Fortunately I

[Bug c++/111281] unhelpful warning output ('nonnull' argument 'v' compared to NULL)

2023-09-03 Thread f.heckenbach--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111281 --- Comment #3 from Frank Heckenbach --- Thanks for the additional info. I still think it would be useful if the message told me that, rather than you. ;) - 'nonnull' is a GCC attribute, and quoting it makes it look like it refers to that,

[Bug c++/111281] unhelpful warning output ('nonnull' argument 'v' compared to NULL)

2023-09-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111281 --- Comment #2 from Andrew Pinski --- >- There is no "nonnull" in the code. It is nonnull since it is a reference. References cannot pointer to null values.

[Bug c++/111281] unhelpful warning output ('nonnull' argument 'v' compared to NULL)

2023-09-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111281 --- Comment #1 from Andrew Pinski --- >- There is no comparison (to NULL or anything else for that matter) in the >code. Actually there is because there is a conversion to bool happening ...