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

          Issue ID: 22703
           Summary: importC: C++11 unscoped enums with underlying type
                    rejects some C types.
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: dave287...@gmail.com

As a followup to #22631, the following enums are rejected:

// test.c
enum L: long long { // 
    L_A = 1,
};

enum U: unsigned long long { // 
    U_A = 1,
};

enum U2: unsigned { //
    U2_A = 1,
};

enum U3: unsigned long { //
    U2_A = 1,
};

Enums deriving from unsigned long are needed for at least the CoreFoundation
framework on macOS.

I believe this line
https://github.com/dlang/dmd/blob/153f706dc1ca871ad68839745b42db5dfcfaf4f2/src/dmd/cparse.d#L3109
should be cparseTypeName(), not parseType().

--

Reply via email to