C++ Logo

sg12

Advanced search

Re: [SG12] [isocpp-core] Do we actually want to include [cpp] in [expr.const]/5.8?

From: Richard Smith <richardsmith_at_[hidden]>
Date: Tue, 16 Nov 2021 13:37:22 -0800
+SG12

I believe SG12 have established at least informal consensus to replace all
UB in the preprocessor with a more suitable rule (either ill-formed or
ill-formed NDR or conditionally-supported or unspecified, but in any case
defined behavior). I don't know what the current status of that work is,
but I think there was a paper at some point.


On Tue, Nov 16, 2021 at 1:02 AM Corentin via Core <core_at_[hidden]>
wrote:

>
>
> On Tue, Nov 16, 2021, 05:15 Mathias Stearn via Core <core_at_[hidden]>
> wrote:
>
>> https://eel.is/c++draft/expr.const#5.8
>>
>> I think it is trying to basically say "core language UB" as opposed to
>> "library UB". But the UB in [cpp] is very different from the other two
>> kinds, and seems closer to if-ndr, or unspeciformed than the modern
>> interpretation of UB. I just looked at all uses of "undefined" in [cpp] and
>> none of them make sense in the context of [expr.const]/5.8. In some cases,
>> like https://eel.is/c++draft/cpp#stringize-2.sentence-7 or
>> https://eel.is/c++draft/cpp#concat-3.sentence-3, I can vaguely see a way
>> of reading it to not being completely nonsense, but that then means that an
>> implementation is required to make something not be a core constant
>> expression based on what happens during macro expansion, which is ... weird.
>>
>> So should we say this instead:
>>
>> an operation that would have undefined behavior as specified in [intro]
>> <del>through</del><ins>up to</ins> [cpp];
>>
>> Alternatively we could say "[intro] through [except]", but that would be
>> more fragile if we ever added a section between [except] and [cpp]
>>
>
> The UB in lex and cpp can either be made well formed or ill-formed
> depending on the case.
> Neither UB or ifndr are suitable behavior.
>
> I offered to write a paper, but as people seems adamant that such paper
> would have to go through half the study groups, i so far haven't found the
> motivation.
>
>
>
>>
>> _______________________________________________
>> Core mailing list
>> Core_at_[hidden]
>> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/core
>> Link to this post: http://lists.isocpp.org/core/2021/11/11670.php
>>
> _______________________________________________
> Core mailing list
> Core_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/core
> Link to this post: http://lists.isocpp.org/core/2021/11/11671.php
>

Received on 2021-11-16 15:38:20