[Issue 11080] assert(`string`) should be forbidden

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 1 18:34:43 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=11080

Nick Treleaven <nick at geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick at geany.org

--- Comment #29 from Nick Treleaven <nick at geany.org> ---
Firstly, issue #4733 is WONTFIX (AIUI due to `if (auto a = array_expr)` being
not nice to rewrite). 

Detecting a string literal first argument to assert is still possible.
Relying on a linter to detect this means most people won't detect it as they
don't run linters.

At DConf 2023, Walter actually had a slide with this bug in it. On the slide
'Positives are self evident' about `version` statements, he had:

`else static assert("unsupported");`

Which always passes. I think that settles the 'how common is this bug?' debate.

--


More information about the Digitalmars-d-bugs mailing list