On Wed, 12 Nov 2025 at 22:36, Jakub Jelinek <[email protected]> wrote: > > Hi! > > Here is a slightly updated version of the patch. > Fixes the mce_unknown case (sets *non_constant_p in that > case so that we e.g. don't try to cache results without emitting > diagnostics), the previous patch was incorrect in that part > and returned the CALL_EXPR instead of void_node while not setting > *non_constant_p. > Doesn't implicitly add W in front of the tag when looking it up, > I think it is better when people write "Wuninitialized" rather than > just "uninitialized". > Emits the tag whenever it is non-empty and warning doesn't emit it, > in similar style/color to the warning [-Woption] strings. > And adds testsuite coverage. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > Note, haven't added user documentation for this because it might change > behavior before C++29 gets something voted in, or perhaps have > the custom tags support added or whatever.
I would be very happy to see this in GCC 16. The ability to "debug" constexpr functions is long overdue. I don't love the inconsistency of having '-' in [-Wfoo] for a tag "Wfoo" only when issuing a warning, but not an error or a message ... but I understand that comes from the existing diagnostic machinery. But I don't really know how the tags should map to command-line options at all. We'll probably need to iterate on that as we get user feedback.
