www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16525] New: C++ member variables have no mangling


          Issue ID: 16525
           Summary: C++ member variables have no mangling
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Keywords: ice
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

cat > bug.d << CODE
static immutable templ(alias var) = 1234;

struct D
    int memvar;

extern(C++) struct CPP
    int memvar;

void test()
    pragma(msg, templ!(D.memvar));
    pragma(msg, templ!(CPP.memvar));
    pragma(msg, CPP.memvar.mangleof); // root cause

dmd -c bug
bug.d(10): Error: variable bug.CPP.memvar Internal Compiler Error: C++ static
non- __gshared non-extern variables not supported

Not sure if C++ defines a member variable mangling, but we need it at a couple
of places and it's blocking issue 16513.

Sep 22 2016