www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18954] New: extern(C++) ICE when `cppmangle` is used


          Issue ID: 18954
           Summary: extern(C++) ICE when `cppmangle` is used
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: turkeyman gmail.com

extern (C++, std)
        extern (C++, class) struct allocator(T)
        extern (C++, struct) 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) {}

The problem is instantiating basic_string!(...)
`basic_string` is mangled as a class, but char_traits is mangled as a struct.
When instantiating basic_string with char_traits as an argument, it triggers an
assert in a weird bit of code insisting that the mangle types be the same (but
they're not)

Jun 07 2018