VS has different name manglings for classes and structs. With the
new extern(C++, class) and extern(C++, struct) declarations, the
name mangling algorithm is changed to use a mangling different
from the used D entity.
A common use case is to map a value type modeled as class in C++ to
a struct in D.
This is backport of https://github.com/dlang/dmd/pull/5875.
The fix for 15839 (accessing this.outer from a member function
inside a nested class) in bb5f550 produces a ThisExp that
refers to the 'this' VarDecl in an outer scope, leading to the
latter being referenced from the nested scope without that being
added to its nestedRefs. Subsequently, the VarDecl is also not
present in the outer FuncDecls closureVars.
This is a weird construct, and outside the AST invariants that
would previously hold. This commit properly at least properly
registers the nested reference, but using a ThisExp in this
manner might not be the cleanest way in the first place.
This is a back-port of DMD commit a117c87a8a (#5741),
and fixes runnable/inner.d.
Notably, the glue layer side of the changed multiple interface
inheritance layout (DMD a54e89d) has not been implemented yet.
This corresponds to DMD commit 3f6a763c0589dd03c1c206eafd434b593702564e.
Also adds the CMake infrastructure to compile and link the D source files.
The build is partially broken:
- A few files in Phobos and druntime do not build
- MSVC build is broken because of unresolved symbols involving reals