C++ Logo


Advanced search

Re: [wg14/wg21 liaison] new revision of P2264R1 make assert() user friendly uploaded

From: Aaron Ballman <aaron_at_[hidden]>
Date: Thu, 7 Oct 2021 12:15:56 -0400
On Tue, Oct 5, 2021 at 5:05 AM Peter Sommerlad (C++) via Liaison
<liaison_at_[hidden]> wrote:
> Hi,
> I am not sure if I am too late, but I created an updated revision of my
> assert(...) paper. It is available on the paper system.
> https://isocpp.org/files/papers/P2264R1.html

Thank you for this, Peter!

> I will be away from my email until Oct 18, so do not expect immediate
> reactions by me, if anyone provides feedback.
> If it should be dead for now and the future, please tell me.
> I could not accomodate the wishes of WG14 to a general solution, so I
> stuck to a C++ standalone wording instead. I let liason judge if it is
> worth pursuing WG14 further, I do not have the stamina to fight for a
> language that I no longer care about for 30 years.

As SG22 chair, I don't see this as being dead but I do see it being at
risk. Our last straw poll on the topic was:

Should the assert macro be changed to be a variadic macro along the
lines of P2264R0?
2 7 2 2 0 (WG21 Consensus)
3 1 0 0 0 (WG14 Consensus)

So we had good support for the functionality within SG22. However,
when you presented to WG14, their straw poll was:

Does WG14 wish to see something along the lines of N2621 in C23:
7/3/8 (No consensus for change)

As you mentioned, they were looking for a more general solution.
However, the pain from the problem with assert specifically is more
apparent in C++ than it is in C and so there may be value in pursuing
a C++-only solution for just assert. That said, the WG14 position of
wanting to solve the general problem instead of a highly targeted fix
for the assert macro also applies in WG21 and that's why I'd say this
is at risk even in C++.

Personally (not as chair), I think in the few situations where this
arises, the workaround is easy enough (surround the asserted expr with
parens) that it'd be hard to justify having an incompatible definition
of the assert macro between languages. However, I think having a more
ergonomic solution than sprinkling parens around would be really
valuable (in assert as well as my own function-like macros).


> Regards
> Peter.
> --
> Peter Sommerlad
> Better Software: Consulting, Training, Reviews
> Modern, Safe & Agile C++
> peter.cpp_at_[hidden]
> +41 79 432 23 32
> _______________________________________________
> Liaison mailing list
> Liaison_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/liaison
> Link to this post: http://lists.isocpp.org/liaison/2021/10/0859.php

Received on 2021-10-07 11:16:19