[Issue 22703] New: importC: C++11 unscoped enums with underlying type rejects some C types.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 25 06:59:02 UTC 2022


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: nobody at puremagic.com
          Reporter: dave287091 at 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().

--


More information about the Digitalmars-d-bugs mailing list