c++: fix explicit/copy problem [PR109247]
[official-gcc.git] / gcc / testsuite / gdc.dg / asm4.d
blobe243c0820ac8ef001ca92c0126203a1a7578c023
1 // https://issues.dlang.org/show_bug.cgi?id=12979
2 // { dg-do compile }
3 // { dg-options "-Wall -Wdeprecated -Werror" }
4 module asm4;
6 void test1()
8 asm pure nothrow @nogc @trusted {}
9 asm @safe {}
12 void test2() pure nothrow @nogc @safe
14 asm pure nothrow @nogc @trusted {}
17 void test3()()
19 asm pure nothrow @nogc @trusted {}
22 static assert(__traits(compiles, () pure nothrow @nogc @safe => test3()));
24 void test4()()
26 asm {}
29 // wait for deprecation of asm pure inference
30 // static assert(!__traits(compiles, () pure => test4()));
31 static assert(!__traits(compiles, () nothrow => test4()));
32 // wait for deprecation of asm @nogc inference
33 // static assert(!__traits(compiles, () @nogc => test4()));
34 static assert(!__traits(compiles, () @safe => test4()));
36 @safe
37 void test5()
39 static assert(!__traits(compiles, { asm { ""; } }() ));