Bug 20701 – extern(C++, class|struct) should not apply to inner types

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2020-03-26T08:58:21Z
Last change time
2024-12-13T19:07:55Z
Assigned to
No Owner
Creator
Mathias LANG
Moved to GitHub: dmd#19685 →

Comments

Comment #0 by pro.mathias.lang — 2020-03-26T08:58:21Z
Consider the following code, compiled with DMD 2.091.0 on Windows x64: ``` extern(C++): extern(C++, class) struct Container { struct Inner { int val; } } void foo (const ref Container.Inner); pragma(msg, foo.mangleof); ``` This will output: `?foo@@YAXABVInner@Container@@@Z` which demangles to `void __cdecl foo(class Container::Inner const &)`. However, `Inner` is not a class, it is a `struct`, and having a similar declaration in C++ will lead to mangling errors.
Comment #1 by robert.schadek — 2024-12-13T19:07:55Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19685 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB