www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22703] New: importC: C++11 unscoped enums with underlying

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 puremagic.com
          Reporter: dave287091 gmail.com



// 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().

--
Jan 24 2022