www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21861] New: ctfe fails when a nested enum or function has a UDA

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

          Issue ID: 21861
           Summary: ctfe fails when a nested enum or function has a UDA
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: eyal weka.io

CTFE execution fails when nested enums or functions have a UDA on them:

    int f() {
         ("S")
        struct S {}

         ("U")
        union U {}

         ("C")
        class C {}

        // CTFE fails on this:
         ("E")
        enum E { X }

        // CTFE fails on this:
         ("f")
        void f() {}

        return 5;
    }

    static assert(f() == 5);

e.g the enum errors out with:

  Error: declaration ` ("E")enum E : int { ... }` is not yet implemented in
CTFE

--
Apr 25 2021