Request for Comment assert(__ctfe)

tsbockman thomas.bockman at gmail.com
Tue Apr 7 19:33:57 UTC 2020


On Tuesday, 7 April 2020 at 17:52:44 UTC, Jacob Carlborg wrote:
> BTW, this is a breaking change. Consider this code:
>
> import core.exception;
>
> void foo()
> {
>     assert(__ctfe);
> }
>
> void main() @system
> {
>     try
>         foo();
>     catch (AssertError)
>     {}
> }

Catching an AssertError thrown by an assert statement is 
officially undefined behavior:
https://dlang.org/spec/expression.html#assert_expressions


More information about the Digitalmars-d mailing list