__traits(getAttribute)

struct A {
    @("enum") enum int c1 = 10;
    @("const") static const int c2 = 20;
}

static assert(__traits(getAttributes, A.c1)[0] == "enum");
static assert(__traits(getAttributes, A.c2)[0] == "const"); // error
fix Issue 10208 - Module-level const/immutable variables with initialization value don't support UDAs