On Thu, Nov 13, 2025 at 09:53:12PM +0900, Hana Dusíková wrote:
> When I was prototyping it in clang, I was trying different approaches, and 
> personally liked the most some sort of prefix like 
> -Wconstexpr:<userdefinedtag> so user code can't create warning/error which 
> would use compiler's own tag. Plus if this will ever get into the standard, 
> there shouldn't not be any prefix in the tag as different compilers can have 
> different CLI options or even interface to enable / disable tag.
> 
> More I think about it ... the tag shouldn't be a string but a type, and tag 
> then can be fully qualified name, that would set clear ownership of errors / 
> warnings to libraries.

Though, agreeing on a particular spelling of template instantiations etc.
might be a nightmare (so that users can ask to disable constexpr messages
with std::tuple<sometype, some_other_type> only etc.).  Perhaps a reflection
of a namespace if namespace would be enough to distinguish library ownership.
Except that std::meta::info argument would make it consteval-only, so it would
then need to be a template with std::meta::info template argument instead.
Or take type and just use the namespace it is contained in as the tag.

        Jakub

Reply via email to