[Issue 21610] New: CTFE should not evaluate both branches for ?: operator

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 4 12:49:50 UTC 2021


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

          Issue ID: 21610
           Summary: CTFE should not evaluate both branches for ?: operator
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at bernis-buecher.de

enum a = false ? 1 / 0 : 1;

does not compile, but produces

/home/D/test.d(1): Error: divide by 0

--


More information about the Digitalmars-d-bugs mailing list