mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
59 lines
1.1 KiB
D
59 lines
1.1 KiB
D
// https://issues.dlang.org/show_bug.cgi?id=15512
|
|
// https://issues.dlang.org/show_bug.cgi?id=19893
|
|
// https://issues.dlang.org/show_bug.cgi?id=19920
|
|
module cppmangle3;
|
|
|
|
version (CppRuntime_Clang) version = CppMangle_Itanium;
|
|
version (CppRuntime_DigitalMars) version = CppMangle_MSVC;
|
|
version (CppRuntime_Gcc) version = CppMangle_Itanium;
|
|
version (CppRuntime_Microsoft) version = CppMangle_MSVC;
|
|
version (CppRuntime_Sun) version = CppMangle_Itanium;
|
|
|
|
extern(C++, "true")
|
|
{
|
|
}
|
|
|
|
extern(C++, "__traits")
|
|
{
|
|
}
|
|
|
|
extern(C++, "foo")
|
|
{
|
|
}
|
|
|
|
int foo; // no name clashing with above namespace
|
|
|
|
extern(C++, "std", "chrono")
|
|
{
|
|
void func();
|
|
}
|
|
|
|
version(CppMangle_MSVC) static assert(func.mangleof == "?func@chrono@std@@YAXXZ");
|
|
else static assert(func.mangleof == "_ZNSt6chrono4funcEv");
|
|
|
|
struct Foo
|
|
{
|
|
extern(C++, "namespace")
|
|
{
|
|
static void bar();
|
|
}
|
|
}
|
|
|
|
alias Alias(alias a) = a;
|
|
alias Alias(T) = T;
|
|
|
|
static assert(is(Alias!(__traits(parent, Foo.bar)) == Foo));
|
|
|
|
extern(C++, "std"):
|
|
debug = def;
|
|
version = def;
|
|
|
|
extern(C++, "std")
|
|
{
|
|
debug = def;
|
|
version = def;
|
|
}
|
|
|
|
extern(C++, "foo")
|
|
extern(C++, "bar")
|
|
version = baz;
|