www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24559] New: Compiler fails to error about using enum type as

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

          Issue ID: 24559
           Summary: Compiler fails to error about using enum type as a
                    value when compiling with -o-
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: eyal weka.io

enum Flags : ubyte { Foo = 1, }

void foo() {
    if(Flags) { // "Flags" as an expression should yield an error, but is only
an error when generating object code, -o- succeeds
    }
}

--
May 23