[Issue 18954] extern(C++) ICE when `cppmangle` is used

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 10 18:22:44 UTC 2018


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

--- Comment #5 from Manu <turkeyman at gmail.com> ---
I just tried to repro with 2.081.1b, this issue as logged above seems to be
resolved.

This variant persists though:

test.d:
--------------------------------------------------------------
extern (C++, std)
{
        extern (C++, class) struct allocator(T)
        {
        }
        struct char_traits(Char)
        {
        }
        extern (C++, class) struct basic_string(T, Traits, Alloc)
        {
        }
        alias string = basic_string!(char, char_traits!char, allocator!char);
}
extern (C++) void test(ref const(std.string) str) {}
--------------------------------------------------------------

I just removed the explicit `extern(C++, struct)` from the struct. It's
declared as a struct, no need to override a struct as struct!

In this code, it gets mangled as a class instead of as a struct, which is
incorrect.

This is only relevant on windows, this issue doesn't affect linux (posix
mangling doesn't distinguish class/struct).

--


More information about the Digitalmars-d-bugs mailing list