Debian Codegraph @

gcc/testsuite/gdc.test/compilable/cppmangle3.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=15512
2 // https://issues.dlang.org/show_bug.cgi?id=19893
3 // https://issues.dlang.org/show_bug.cgi?id=19920
4 module cppmangle3;
5
6 version (CppRuntime_LLVM) version = CppMangle_Itanium;
7 version (CppRuntime_GNU) version = CppMangle_Itanium;
8 version (CppRuntime_Microsoft) version = CppMangle_MSVC;
9 version (CppRuntime_Sun) version = CppMangle_Itanium;
10
11 extern(C++, "true")
12 {
13 }
14
15 extern(C++, "__traits")
16 {
17 }
18
19 extern(C++, "foo")
20 {
21 }
22
23 int foo; // no name clashing with above namespace
24
25 extern(C++, "std", "chrono")
26 {
27 void func();
28 }
29
30 version(CppMangle_MSVC) static assert(func.mangleof == "?func@chrono@std@@YAXXZ");
31 else static assert(func.mangleof == "_ZNSt6chrono4funcEv");
32
33 struct Foo
34 {
35 extern(C++, "namespace")
36 {
37 static void bar();
38 }
39 }
40
41 alias Alias(alias a) = a;
42 alias Alias(T) = T;
43
44 static assert(is(Alias!(__traits(parent, Foo.bar)) == Foo));
45
46 extern(C++, "std"):
47 debug = def;
48 version = def;
49
50 extern(C++, "std")
51 {
52 debug = def;
53 version = def;
54 }
55
56 extern(C++, "foo")
57 extern(C++, "bar")
58 version = baz;