www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19658] New: C++ enum mangling is wrong on Windows for other

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

          Issue ID: 19658
           Summary: C++ enum mangling is wrong on Windows for other
                    integer types
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ilyayaroshenko gmail.com

D generates the wrong C++ mangling names for enums on Windows when not an `int`
integral type is used for enum declaration.

D:
extern(C++):
enum E : short {a, b}
E foo(E e) {return e;}

C++:
enum class E : short {a, b};
E foo(E e) {return e;}

For all integer types (including char) C++ generates the same mangling name.
However, D generates unique mangling name for each integer type. All mangling
name should have the same mangling as the common enum variant for `int`.

--
Feb 07 2019