www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14387] New: Disallow string literals as assert conditions


          Issue ID: 14387
           Summary: Disallow string literals as assert conditions
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: schuetzm gmx.net

void foo(int x) {
        static assert("bar");
            assert("x has the invalid value of " ~ x.to!string);

These should be disallowed, because it's too easy to forget the `0` as first
argument. Other expression that are concatenations of string literals should be
kept, of course.

Apr 01 2015