aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-04-29 10:19:55 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2020-04-29 10:36:00 +0200
commit75f758a703924184fc07b01a138bb6f0028d077c (patch)
tree9b90b2c92161b246f7acd4494c5b1a2a3e4f1d09 /gcc/testsuite/gdc.test
parentd81bc2af7d2700888e414eb5a322ff5f5b0df0bb (diff)
downloadgcc-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/testsuite/gdc.test')
-rw-r--r--gcc/testsuite/gdc.test/compilable/test17419.d18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/compilable/test17419.d b/gcc/testsuite/gdc.test/compilable/test17419.d
index 219ed4f..d67c5b9 100644
--- a/gcc/testsuite/gdc.test/compilable/test17419.d
+++ b/gcc/testsuite/gdc.test/compilable/test17419.d
@@ -35,3 +35,21 @@ void bar()
void nested() { }
static assert(__traits(getLinkage, typeof(&nested)) == "D");
}
+
+class FooD {}
+interface FooDInterface {}
+extern (C++) class FooCpp {}
+extern (C++) struct FooCppStruct {}
+extern (C++) interface FooCppInterface {}
+
+static assert(__traits(getLinkage, FooD) == "D");
+static assert(__traits(getLinkage, FooDInterface) == "D");
+static assert(__traits(getLinkage, FooCpp) == "C++");
+static assert(__traits(getLinkage, FooCppStruct) == "C++");
+static assert(__traits(getLinkage, FooCppInterface) == "C++");
+
+version (D_ObjectiveC)
+{
+ extern (Objective-C) interface FooObjC {}
+ static assert(__traits(getLinkage, FooObjC) == "Objective-C");
+}