C++ Logo

sg12

Advanced search

Re: [SG12] [isocpp-core] Implementation defining undefined behavior

From: Hubert Tong <hubert.reinterpretcast_at_[hidden]>
Date: Tue, 21 Sep 2021 11:48:10 -0400
On Tue, Sep 21, 2021 at 11:44 AM Herring, Davis via Core <
core_at_[hidden]> wrote:

> > I'm thinking specifically about floating point division by zero, which
> > sometimes hits a hardware exception and sometimes produces
> > floating-point infinity (when is_iec559 is true).
> >
> > As with other cases of undefined behavior, this is made testable by
> > constexpr. Can an implementation say that a construct that is
> > undefined in the C++ standard is defined in that implementation, and
> > therefore accept it in constexpr?
>
> For this case in particular, SG6 (or at least Lawrence) has in the past
> recommended against supporting it <
> https://wiki.edg.com/bin/view/Wg21issaquah2016/CoreWorkingGroup#Core_issue_2168_Narrowing_conver>
> <https://lists.isocpp.org/sci/2016/03/0000.php>.
>
> More generally, I don't think it's conforming to "define undefined
> behavior" during constant evaluation, even though it obviously is so at
> runtime. Of course, you can always issue a diagnostic and accept the
> program anyway.
>

And enjoy much fun with SFINAE (and with extensions like VLAs).


>
> Davis
> _______________________________________________
> 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/09/11539.php
>

Received on 2021-09-21 10:48:38