Bug 19658 – C++ enum mangling is wrong on Windows for other integer types
Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2019-02-07T11:58:07Z
Last change time
2019-04-13T08:47:51Z
Keywords
C++, industry, mangling, pull
Assigned to
No Owner
Creator
Илья Ярошенко
Comments
Comment #0 by ilyayaroshenko — 2019-02-07T11:58:07Z
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`.