Date: Wed, 19 Aug 2026 15:30:46 +0200
On Wed, Aug 19, 2026 at 3:26 PM Rainer Deyke via Std-Proposals <
std-proposals_at_[hidden]> wrote:
>
>
> On 8/19/26 05:37, Ville Voutilainen via Std-Proposals wrote:
> > On Wed, 19 Aug 2026 at 05:54, Sebastian Wittmeier via Std-Proposals
> > <std-proposals_at_[hidden]> wrote:
> >>
> >> If P2900 is staying, can you define (= propose) a 5th mode that acts
> like compile_assert and also hope that the implementations give better
> error messages and locations than an undefined violation handler?
> >
> > I don't know about others, but yes, yes I can:
> https://godbolt.org/z/xPz8hjcYY
>
> I don't see the precondition violation. `use_definitely_unsound` is a
> perfectly fine function for getting a -1 so long as its implicit
> precondition of not passing in a vector of exactly 5 elements is met.
> Nothing in the program violates this implicit precondition.
>
> Implicit preconditions still exist, right? There is no way to encode
> every precondition into something the compiler understands.
>
If a branch exists with definite UB but it's never called is the program
still ill-formed? For my own software I want that to be yes, but for C++ in
general I think so far we have no, and changing such a thing will be a
breaking change for many.
std-proposals_at_[hidden]> wrote:
>
>
> On 8/19/26 05:37, Ville Voutilainen via Std-Proposals wrote:
> > On Wed, 19 Aug 2026 at 05:54, Sebastian Wittmeier via Std-Proposals
> > <std-proposals_at_[hidden]> wrote:
> >>
> >> If P2900 is staying, can you define (= propose) a 5th mode that acts
> like compile_assert and also hope that the implementations give better
> error messages and locations than an undefined violation handler?
> >
> > I don't know about others, but yes, yes I can:
> https://godbolt.org/z/xPz8hjcYY
>
> I don't see the precondition violation. `use_definitely_unsound` is a
> perfectly fine function for getting a -1 so long as its implicit
> precondition of not passing in a vector of exactly 5 elements is met.
> Nothing in the program violates this implicit precondition.
>
> Implicit preconditions still exist, right? There is no way to encode
> every precondition into something the compiler understands.
>
If a branch exists with definite UB but it's never called is the program
still ill-formed? For my own software I want that to be yes, but for C++ in
general I think so far we have no, and changing such a thing will be a
breaking change for many.
Received on 2026-08-19 13:31:04
