| 1 |
/* TEST_OUTPUT: |
| 2 |
--- |
| 3 |
fail_compilation/test23536.d(104): Error: function `test23536.S.nonctor` cannot be a non-static member function for `pragma(crt_constructor)` |
| 4 |
fail_compilation/test23536.d(106): Error: function `test23536.S.nondtor` cannot be a non-static member function for `pragma(crt_destructor)` |
| 5 |
--- |
| 6 |
*/ |
| 7 |
|
| 8 |
// https://issues.dlang.org/show_bug.cgi?id=23536 |
| 9 |
|
| 10 |
#line 100 |
| 11 |
|
| 12 |
struct S |
| 13 |
{ |
| 14 |
int x; |
| 15 |
extern (C) pragma(crt_constructor) void nonctor() { } // should not compile |
| 16 |
extern (C) pragma(crt_constructor) static void stactor() { } // should compile |
| 17 |
extern (C) pragma(crt_destructor) void nondtor() { } // should not compile |
| 18 |
extern (C) pragma(crt_destructor) static void stadtor() { } // should compile |
| 19 |
} |