dmd/compiler/test/fail_compilation/standalone_modctor.d
Dennis 14ecea9ea7
Add @standalone attribute for module constructors (#15537)
* Add `@__standalone` attribute

* Remove underscores from __standalone
2023-12-22 11:03:03 -08:00

15 lines
625 B
D

/**
TEST_OUTPUT:
---
fail_compilation/standalone_modctor.d(11): Error: `@standalone` can only be used on shared static constructors
fail_compilation/standalone_modctor.d(12): Error: a module constructor using `@standalone` must be `@system` or `@trusted`
fail_compilation/standalone_modctor.d(13): Error: a module constructor using `@standalone` must be `@system` or `@trusted`
---
*/
import core.attribute : standalone;
@standalone static this() {}
@standalone shared static this() {}
@standalone shared static this() @safe {}
@standalone shared static this() @trusted {}
@standalone shared static this() @system {}