[Issue 20701] New: extern(C++, class|struct) should not apply to inner types
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Mar 26 08:58:21 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=20701
Issue ID: 20701
Summary: extern(C++, class|struct) should not apply to inner
types
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: pro.mathias.lang at gmail.com
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 at 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.
--
More information about the Digitalmars-d-bugs
mailing list