diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-04-29 10:19:55 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-04-29 10:36:00 +0200 |
commit | 75f758a703924184fc07b01a138bb6f0028d077c (patch) | |
tree | 9b90b2c92161b246f7acd4494c5b1a2a3e4f1d09 /gcc/d/dmd/dstruct.c | |
parent | d81bc2af7d2700888e414eb5a322ff5f5b0df0bb (diff) | |
download | gcc-75f758a703924184fc07b01a138bb6f0028d077c.zip gcc-75f758a703924184fc07b01a138bb6f0028d077c.tar.gz gcc-75f758a703924184fc07b01a138bb6f0028d077c.tar.bz2 |
d: Merge bug fix from upstream dmd 06160ccae
Adds classKind information to the front-end AST, which in turn allows us
to fix code generation of type names for extern(C) and extern(C++)
structs and classes. Inspecting such types inside a debugger now just
works without the need to 'cast(module_name.cxx_type)'.
gcc/d/ChangeLog:
* d-codegen.cc (d_decl_context): Don't include module in the name of
class and struct types that aren't extern(D).
Diffstat (limited to 'gcc/d/dmd/dstruct.c')
-rw-r--r-- | gcc/d/dmd/dstruct.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/d/dmd/dstruct.c b/gcc/d/dmd/dstruct.c index 10771c95..0a33cc2 100644 --- a/gcc/d/dmd/dstruct.c +++ b/gcc/d/dmd/dstruct.c @@ -194,6 +194,7 @@ AggregateDeclaration::AggregateDeclaration(Loc loc, Identifier *id) sizeok = SIZEOKnone; // size not determined yet deferred = NULL; isdeprecated = false; + classKind = ClassKind::d; inv = NULL; aggNew = NULL; aggDelete = NULL; @@ -1071,6 +1072,9 @@ void StructDeclaration::semantic(Scope *sc) if (storage_class & STCabstract) error("structs, unions cannot be abstract"); userAttribDecl = sc->userAttribDecl; + + if (sc->linkage == LINKcpp) + classKind = ClassKind::cpp; } else if (symtab && !scx) { |