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
}
CODE
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.
Comment #1 by github-bugzilla — 2016-09-25T04:54:09Z