C++ Logo

sg15

Advanced search

Re: [isocpp-sg15] [P2758] Emitting messages at compile time

From: Aaron Ballman <aaron_at_[hidden]>
Date: Tue, 22 Oct 2024 21:13:55 -0400
On Tue, Oct 22, 2024 at 1:46 PM Barry Revzin <barry.revzin_at_[hidden]> wrote:
>
>
>
> On Wed, Oct 16, 2024 at 8:40 AM Aaron Ballman <aaron_at_[hidden]> wrote:
>>
>> On Wed, Oct 16, 2024 at 6:10 AM Jonathan Wakely <cxx_at_[hidden]> wrote:
>> >
>> >
>> >
>> > On Tue, 15 Oct 2024 at 18:53, Aaron Ballman via SG15 <sg15_at_[hidden]> wrote:
>> >>
>> >> Thanks! FWIW, users do want this sort of capability, but the fact that
>> >> no implementation has yet to add a feature with bells and whistles is
>> >> because the problem is not easy to solve. I'm highly skeptical that
>> >> this is something WG21 should be standardizing at all currently; it's
>> >> firmly in the realm of QoI and different implementations have
>> >> different needs (and our needs evolve over time). The only form of the
>> >> feature I would consider supporting would be one that accepts the
>> >> message to be printed during constant evaluation and nothing else.
>> >> Anything with more bells and whistles will be problematic in practice.
>> >>
>> >> Practical implementability problems include:
>> >> * Different implementations have different severities for diagnostics
>> >> (error, warning, note, remark, no severity distinctions, etc)
>> >
>> >
>> > We already have a distinction between #error and #warning, how is this any different?
>> > constexpr_print just outputs a message at compile time (which you've said is fine).
>>
>> Because it adds another layer of distinction (constexpr_print_str)
>> which may or may not make sense to any given implementation. In Clang
>> specifically, is that a note or a remark? (There are problems with
>> whichever one we pick, so it'd probably be an entirely new thing, but
>> none of our users have actually asked for something like that, at
>> least that I'm aware of.)
>
>
> I've been thinking of how you expect me to respond to this, and I'm still not entirely sure. You're not aware of ANY of your users having asked for something like this? Not even the user who is asking for something like this so hard that he wrote a paper, took it through several groups, and got strong (nearly unanimous) consensus for its adoption?

There are no feature requests for such a thing on Clang's issue
tracker, nor was there a question or RFC on our Discourse forums, and
no PRs were opened trying to implement the feature, and I couldn't
find any blog posts about such a feature for, etc. So yes, I'm not
aware of any users asking for something like constexpr_print despite
there being several instances where users have asked for things like
directly emitting errors or warnings.

~Aaron

>
> Barry

Received on 2024-10-23 01:14:09