| 1 |
// https://issues.dlang.org/show_bug.cgi?id=16575 |
| 2 |
/* |
| 3 |
REQUIRED_ARGS: -m64 |
| 4 |
TEST_OUTPUT: |
| 5 |
--- |
| 6 |
fail_compilation/fail16575.d(10): Error: function `immNull` cannot have parameter of type `immutable(typeof(null))*` because its linkage is `extern(C++)` |
| 7 |
fail_compilation/fail16575.d(11): Error: function `shaNull` cannot have parameter of type `shared(typeof(null))*` because its linkage is `extern(C++)` |
| 8 |
fail_compilation/fail16575.d(20): Error: function `immNoReturn` cannot have parameter of type `immutable(noreturn)*` because its linkage is `extern(C++)` |
| 9 |
fail_compilation/fail16575.d(21): Error: function `shaNoReturn` cannot have parameter of type `shared(noreturn)*` because its linkage is `extern(C++)` |
| 10 |
fail_compilation/fail16575.d(30): Error: function `immBasic` cannot have parameter of type `immutable(int)*` because its linkage is `extern(C++)` |
| 11 |
fail_compilation/fail16575.d(31): Error: function `shaBasic` cannot have parameter of type `shared(int)*` because its linkage is `extern(C++)` |
| 12 |
fail_compilation/fail16575.d(40): Error: function `immVector` cannot have parameter of type `immutable(__vector(long[2]))*` because its linkage is `extern(C++)` |
| 13 |
fail_compilation/fail16575.d(41): Error: function `shaVector` cannot have parameter of type `shared(__vector(long[2]))*` because its linkage is `extern(C++)` |
| 14 |
fail_compilation/fail16575.d(50): Error: function `immSArray` cannot have parameter of type `immutable(long[2])` because its linkage is `extern(C++)` |
| 15 |
fail_compilation/fail16575.d(50): perhaps use a `long*` type instead |
| 16 |
fail_compilation/fail16575.d(51): Error: function `shaSArray` cannot have parameter of type `shared(long[2])` because its linkage is `extern(C++)` |
| 17 |
fail_compilation/fail16575.d(51): perhaps use a `long*` type instead |
| 18 |
fail_compilation/fail16575.d(60): Error: function `immPointer` cannot have parameter of type `immutable(int*)` because its linkage is `extern(C++)` |
| 19 |
fail_compilation/fail16575.d(61): Error: function `shaPointer` cannot have parameter of type `shared(int*)` because its linkage is `extern(C++)` |
| 20 |
fail_compilation/fail16575.d(71): Error: function `immStruct` cannot have parameter of type `immutable(SPP)*` because its linkage is `extern(C++)` |
| 21 |
fail_compilation/fail16575.d(72): Error: function `shaStruct` cannot have parameter of type `shared(SPP)*` because its linkage is `extern(C++)` |
| 22 |
fail_compilation/fail16575.d(81): Error: function `immClass` cannot have parameter of type `immutable(CPP)` because its linkage is `extern(C++)` |
| 23 |
fail_compilation/fail16575.d(82): Error: function `shaClass` cannot have parameter of type `shared(CPP)` because its linkage is `extern(C++)` |
| 24 |
fail_compilation/fail16575.d(91): Error: function `immEnum` cannot have parameter of type `immutable(EPP)*` because its linkage is `extern(C++)` |
| 25 |
fail_compilation/fail16575.d(92): Error: function `shaEnum` cannot have parameter of type `shared(EPP)*` because its linkage is `extern(C++)` |
| 26 |
fail_compilation/fail16575.d(100): Error: function `typeDArray` cannot have parameter of type `int[]` because its linkage is `extern(C++)` |
| 27 |
fail_compilation/fail16575.d(101): Error: function `typeAArray` cannot have parameter of type `int[int]` because its linkage is `extern(C++)` |
| 28 |
fail_compilation/fail16575.d(102): Error: function `typeDelegate` cannot have parameter of type `extern (C++) int delegate()` because its linkage is `extern(C++)` |
| 29 |
--- |
| 30 |
*/ |
| 31 |
|
| 32 |
#line 10 |
| 33 |
extern(C++) void immNull(immutable(typeof(null))* a) {} |
| 34 |
extern(C++) void shaNull(shared(typeof(null))* a) {} |
| 35 |
#line 20 |
| 36 |
extern(C++) void immNoReturn(immutable(typeof(*null))* a) {} |
| 37 |
extern(C++) void shaNoReturn(shared(typeof(*null))* a) {} |
| 38 |
#line 30 |
| 39 |
extern(C++) void immBasic(immutable(int)* a) {} |
| 40 |
extern(C++) void shaBasic(shared(int)* a) {} |
| 41 |
#line 40 |
| 42 |
extern(C++) void immVector(immutable(__vector(long[2]))* a) {} |
| 43 |
extern(C++) void shaVector(shared(__vector(long[2]))* a) {} |
| 44 |
#line 50 |
| 45 |
extern(C++) void immSArray(immutable(long[2]) a) {} |
| 46 |
extern(C++) void shaSArray(shared(long[2]) a) {} |
| 47 |
#line 60 |
| 48 |
extern(C++) void immPointer(immutable(int*) a) {} |
| 49 |
extern(C++) void shaPointer(shared(int*) a) {} |
| 50 |
#line 70 |
| 51 |
extern(C++) struct SPP {} |
| 52 |
extern(C++) void immStruct(immutable(SPP)* a) {} |
| 53 |
extern(C++) void shaStruct(shared(SPP)* a) {} |
| 54 |
#line 80 |
| 55 |
extern(C++) class CPP {} |
| 56 |
extern(C++) void immClass(immutable CPP a) {} |
| 57 |
extern(C++) void shaClass(shared CPP a) {} |
| 58 |
#line 90 |
| 59 |
extern(C++) enum EPP {a} |
| 60 |
extern(C++) void immEnum(immutable(EPP)* a) {} |
| 61 |
extern(C++) void shaEnum(shared(EPP)* a) {} |
| 62 |
# line 100 |
| 63 |
extern(C++) void typeDArray(int[] a) {} |
| 64 |
extern(C++) void typeAArray(int[int] a) {} |
| 65 |
extern(C++) void typeDelegate(int delegate() a) {} |