| 1 |
/* |
| 2 |
REQUIRED_ARGS: |
| 3 |
TEST_OUTPUT: |
| 4 |
--- |
| 5 |
fail_compilation/dep_d1_ops.d(281): Error: operator `+` is not defined for type `S` |
| 6 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinary(string op : "+")(int rhs) {}` |
| 7 |
fail_compilation/dep_d1_ops.d(282): Error: operator `+` is not defined for type `S` |
| 8 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinaryRight(string op : "+")(int rhs) {}` |
| 9 |
fail_compilation/dep_d1_ops.d(283): Error: operator `-` is not defined for type `S` |
| 10 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinary(string op : "-")(int rhs) {}` |
| 11 |
fail_compilation/dep_d1_ops.d(284): Error: operator `-` is not defined for type `S` |
| 12 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinaryRight(string op : "-")(int rhs) {}` |
| 13 |
fail_compilation/dep_d1_ops.d(285): Error: operator `*` is not defined for type `S` |
| 14 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinary(string op : "*")(int rhs) {}` |
| 15 |
fail_compilation/dep_d1_ops.d(286): Error: operator `*` is not defined for type `S` |
| 16 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinaryRight(string op : "*")(int rhs) {}` |
| 17 |
fail_compilation/dep_d1_ops.d(287): Error: operator `/` is not defined for type `S` |
| 18 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinary(string op : "/")(int rhs) {}` |
| 19 |
fail_compilation/dep_d1_ops.d(288): Error: operator `/` is not defined for type `S` |
| 20 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinaryRight(string op : "/")(int rhs) {}` |
| 21 |
fail_compilation/dep_d1_ops.d(289): Error: operator `%` is not defined for type `S` |
| 22 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinary(string op : "%")(int rhs) {}` |
| 23 |
fail_compilation/dep_d1_ops.d(290): Error: operator `%` is not defined for type `S` |
| 24 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinaryRight(string op : "%")(int rhs) {}` |
| 25 |
fail_compilation/dep_d1_ops.d(292): Error: operator `&` is not defined for type `S` |
| 26 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinary(string op : "&")(int rhs) {}` |
| 27 |
fail_compilation/dep_d1_ops.d(293): Error: operator `|` is not defined for type `S` |
| 28 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinary(string op : "|")(int rhs) {}` |
| 29 |
fail_compilation/dep_d1_ops.d(294): Error: operator `^` is not defined for type `S` |
| 30 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinary(string op : "^")(int rhs) {}` |
| 31 |
fail_compilation/dep_d1_ops.d(296): Error: operator `<<` is not defined for type `S` |
| 32 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinary(string op : "<<")(int rhs) {}` |
| 33 |
fail_compilation/dep_d1_ops.d(297): Error: operator `<<` is not defined for type `S` |
| 34 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinaryRight(string op : "<<")(int rhs) {}` |
| 35 |
fail_compilation/dep_d1_ops.d(298): Error: operator `>>` is not defined for type `S` |
| 36 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinary(string op : ">>")(int rhs) {}` |
| 37 |
fail_compilation/dep_d1_ops.d(299): Error: operator `>>` is not defined for type `S` |
| 38 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinaryRight(string op : ">>")(int rhs) {}` |
| 39 |
fail_compilation/dep_d1_ops.d(300): Error: operator `>>>` is not defined for type `S` |
| 40 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinary(string op : ">>>")(int rhs) {}` |
| 41 |
fail_compilation/dep_d1_ops.d(301): Error: operator `>>>` is not defined for type `S` |
| 42 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinaryRight(string op : ">>>")(int rhs) {}` |
| 43 |
fail_compilation/dep_d1_ops.d(303): Error: operator `~` is not defined for type `S` |
| 44 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinary(string op : "~")(int rhs) {}` |
| 45 |
fail_compilation/dep_d1_ops.d(304): Error: operator `~` is not defined for type `S` |
| 46 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinaryRight(string op : "~")(int rhs) {}` |
| 47 |
fail_compilation/dep_d1_ops.d(306): Error: operator `+` is not defined for `S` |
| 48 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opUnary(string op : "+")() {}` |
| 49 |
fail_compilation/dep_d1_ops.d(307): Error: operator `-` is not defined for `S` |
| 50 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opUnary(string op : "-")() {}` |
| 51 |
fail_compilation/dep_d1_ops.d(308): Error: operator `~` is not defined for `S` |
| 52 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opUnary(string op : "~")() {}` |
| 53 |
fail_compilation/dep_d1_ops.d(309): Error: operator `++` not supported for `s` of type `S` |
| 54 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opUnary(string op : "++")() {}` or `auto opOpAssign(string op : "+")(int) {}` |
| 55 |
fail_compilation/dep_d1_ops.d(310): Error: operator `--` not supported for `s` of type `S` |
| 56 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opUnary(string op : "--")() {}` or `auto opOpAssign(string op : "-")(int) {}` |
| 57 |
fail_compilation/dep_d1_ops.d(311): Error: operator `*` is not defined for `S` |
| 58 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opUnary(string op : "*")() {}` |
| 59 |
fail_compilation/dep_d1_ops.d(313): Error: operator `in` is not defined for type `S` |
| 60 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinary(string op : "in")(int rhs) {}` |
| 61 |
fail_compilation/dep_d1_ops.d(314): Error: operator `in` is not defined for type `S` |
| 62 |
fail_compilation/dep_d1_ops.d(174): perhaps overload the operator with `auto opBinaryRight(string op : "in")(int rhs) {}` |
| 63 |
fail_compilation/dep_d1_ops.d(316): Error: operator `+=` not supported for `s` of type `S` |
| 64 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opOpAssign(string op : "+")(int) {}` |
| 65 |
fail_compilation/dep_d1_ops.d(317): Error: operator `-=` not supported for `s` of type `S` |
| 66 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opOpAssign(string op : "-")(int) {}` |
| 67 |
fail_compilation/dep_d1_ops.d(318): Error: operator `*=` not supported for `s` of type `S` |
| 68 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opOpAssign(string op : "*")(int) {}` |
| 69 |
fail_compilation/dep_d1_ops.d(319): Error: operator `/=` not supported for `s` of type `S` |
| 70 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opOpAssign(string op : "/")(int) {}` |
| 71 |
fail_compilation/dep_d1_ops.d(320): Error: operator `%=` not supported for `s` of type `S` |
| 72 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opOpAssign(string op : "%")(int) {}` |
| 73 |
fail_compilation/dep_d1_ops.d(321): Error: operator `&=` not supported for `s` of type `S` |
| 74 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opOpAssign(string op : "&")(int) {}` |
| 75 |
fail_compilation/dep_d1_ops.d(322): Error: operator `|=` not supported for `s` of type `S` |
| 76 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opOpAssign(string op : "|")(int) {}` |
| 77 |
fail_compilation/dep_d1_ops.d(323): Error: operator `^=` not supported for `s` of type `S` |
| 78 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opOpAssign(string op : "^")(int) {}` |
| 79 |
fail_compilation/dep_d1_ops.d(324): Error: operator `<<=` not supported for `s` of type `S` |
| 80 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opOpAssign(string op : "<<")(int) {}` |
| 81 |
fail_compilation/dep_d1_ops.d(325): Error: operator `>>=` not supported for `s` of type `S` |
| 82 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opOpAssign(string op : ">>")(int) {}` |
| 83 |
fail_compilation/dep_d1_ops.d(326): Error: operator `>>>=` not supported for `s` of type `S` |
| 84 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opOpAssign(string op : ">>>")(int) {}` |
| 85 |
fail_compilation/dep_d1_ops.d(327): Error: operator `~=` not supported for `s` of type `S` |
| 86 |
fail_compilation/dep_d1_ops.d(174): perhaps implement `auto opOpAssign(string op : "~")(int) {}` |
| 87 |
fail_compilation/dep_d1_ops.d(331): Error: operator `+` is not defined for type `dep_d1_ops.C` |
| 88 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinary(string op : "+")(int rhs) {}` |
| 89 |
fail_compilation/dep_d1_ops.d(332): Error: operator `+` is not defined for type `dep_d1_ops.C` |
| 90 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinaryRight(string op : "+")(int rhs) {}` |
| 91 |
fail_compilation/dep_d1_ops.d(333): Error: operator `-` is not defined for type `dep_d1_ops.C` |
| 92 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinary(string op : "-")(int rhs) {}` |
| 93 |
fail_compilation/dep_d1_ops.d(334): Error: operator `-` is not defined for type `dep_d1_ops.C` |
| 94 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinaryRight(string op : "-")(int rhs) {}` |
| 95 |
fail_compilation/dep_d1_ops.d(335): Error: operator `*` is not defined for type `dep_d1_ops.C` |
| 96 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinary(string op : "*")(int rhs) {}` |
| 97 |
fail_compilation/dep_d1_ops.d(336): Error: operator `*` is not defined for type `dep_d1_ops.C` |
| 98 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinaryRight(string op : "*")(int rhs) {}` |
| 99 |
fail_compilation/dep_d1_ops.d(337): Error: operator `/` is not defined for type `dep_d1_ops.C` |
| 100 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinary(string op : "/")(int rhs) {}` |
| 101 |
fail_compilation/dep_d1_ops.d(338): Error: operator `/` is not defined for type `dep_d1_ops.C` |
| 102 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinaryRight(string op : "/")(int rhs) {}` |
| 103 |
fail_compilation/dep_d1_ops.d(339): Error: operator `%` is not defined for type `dep_d1_ops.C` |
| 104 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinary(string op : "%")(int rhs) {}` |
| 105 |
fail_compilation/dep_d1_ops.d(340): Error: operator `%` is not defined for type `dep_d1_ops.C` |
| 106 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinaryRight(string op : "%")(int rhs) {}` |
| 107 |
fail_compilation/dep_d1_ops.d(342): Error: operator `&` is not defined for type `dep_d1_ops.C` |
| 108 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinary(string op : "&")(int rhs) {}` |
| 109 |
fail_compilation/dep_d1_ops.d(343): Error: operator `|` is not defined for type `dep_d1_ops.C` |
| 110 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinary(string op : "|")(int rhs) {}` |
| 111 |
fail_compilation/dep_d1_ops.d(344): Error: operator `^` is not defined for type `dep_d1_ops.C` |
| 112 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinary(string op : "^")(int rhs) {}` |
| 113 |
fail_compilation/dep_d1_ops.d(346): Error: operator `<<` is not defined for type `dep_d1_ops.C` |
| 114 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinary(string op : "<<")(int rhs) {}` |
| 115 |
fail_compilation/dep_d1_ops.d(347): Error: operator `<<` is not defined for type `dep_d1_ops.C` |
| 116 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinaryRight(string op : "<<")(int rhs) {}` |
| 117 |
fail_compilation/dep_d1_ops.d(348): Error: operator `>>` is not defined for type `dep_d1_ops.C` |
| 118 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinary(string op : ">>")(int rhs) {}` |
| 119 |
fail_compilation/dep_d1_ops.d(349): Error: operator `>>` is not defined for type `dep_d1_ops.C` |
| 120 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinaryRight(string op : ">>")(int rhs) {}` |
| 121 |
fail_compilation/dep_d1_ops.d(350): Error: operator `>>>` is not defined for type `dep_d1_ops.C` |
| 122 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinary(string op : ">>>")(int rhs) {}` |
| 123 |
fail_compilation/dep_d1_ops.d(351): Error: operator `>>>` is not defined for type `dep_d1_ops.C` |
| 124 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinaryRight(string op : ">>>")(int rhs) {}` |
| 125 |
fail_compilation/dep_d1_ops.d(353): Error: operator `~` is not defined for type `dep_d1_ops.C` |
| 126 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinary(string op : "~")(int rhs) {}` |
| 127 |
fail_compilation/dep_d1_ops.d(354): Error: operator `~` is not defined for type `dep_d1_ops.C` |
| 128 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinaryRight(string op : "~")(int rhs) {}` |
| 129 |
fail_compilation/dep_d1_ops.d(356): Error: operator `+` is not defined for `C` |
| 130 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opUnary(string op : "+")() {}` |
| 131 |
fail_compilation/dep_d1_ops.d(357): Error: operator `-` is not defined for `C` |
| 132 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opUnary(string op : "-")() {}` |
| 133 |
fail_compilation/dep_d1_ops.d(358): Error: operator `~` is not defined for `C` |
| 134 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opUnary(string op : "~")() {}` |
| 135 |
fail_compilation/dep_d1_ops.d(359): Error: operator `++` not supported for `c` of type `C` |
| 136 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opUnary(string op : "++")() {}` or `auto opOpAssign(string op : "+")(int) {}` |
| 137 |
fail_compilation/dep_d1_ops.d(360): Error: operator `--` not supported for `c` of type `C` |
| 138 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opUnary(string op : "--")() {}` or `auto opOpAssign(string op : "-")(int) {}` |
| 139 |
fail_compilation/dep_d1_ops.d(361): Error: operator `*` is not defined for `C` |
| 140 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opUnary(string op : "*")() {}` |
| 141 |
fail_compilation/dep_d1_ops.d(363): Error: operator `in` is not defined for type `dep_d1_ops.C` |
| 142 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinary(string op : "in")(int rhs) {}` |
| 143 |
fail_compilation/dep_d1_ops.d(364): Error: operator `in` is not defined for type `dep_d1_ops.C` |
| 144 |
fail_compilation/dep_d1_ops.d(225): perhaps overload the operator with `auto opBinaryRight(string op : "in")(int rhs) {}` |
| 145 |
fail_compilation/dep_d1_ops.d(366): Error: operator `+=` not supported for `c` of type `C` |
| 146 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opOpAssign(string op : "+")(int) {}` |
| 147 |
fail_compilation/dep_d1_ops.d(367): Error: operator `-=` not supported for `c` of type `C` |
| 148 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opOpAssign(string op : "-")(int) {}` |
| 149 |
fail_compilation/dep_d1_ops.d(368): Error: operator `*=` not supported for `c` of type `C` |
| 150 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opOpAssign(string op : "*")(int) {}` |
| 151 |
fail_compilation/dep_d1_ops.d(369): Error: operator `/=` not supported for `c` of type `C` |
| 152 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opOpAssign(string op : "/")(int) {}` |
| 153 |
fail_compilation/dep_d1_ops.d(370): Error: operator `%=` not supported for `c` of type `C` |
| 154 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opOpAssign(string op : "%")(int) {}` |
| 155 |
fail_compilation/dep_d1_ops.d(371): Error: operator `&=` not supported for `c` of type `C` |
| 156 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opOpAssign(string op : "&")(int) {}` |
| 157 |
fail_compilation/dep_d1_ops.d(372): Error: operator `|=` not supported for `c` of type `C` |
| 158 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opOpAssign(string op : "|")(int) {}` |
| 159 |
fail_compilation/dep_d1_ops.d(373): Error: operator `^=` not supported for `c` of type `C` |
| 160 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opOpAssign(string op : "^")(int) {}` |
| 161 |
fail_compilation/dep_d1_ops.d(374): Error: operator `<<=` not supported for `c` of type `C` |
| 162 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opOpAssign(string op : "<<")(int) {}` |
| 163 |
fail_compilation/dep_d1_ops.d(375): Error: operator `>>=` not supported for `c` of type `C` |
| 164 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opOpAssign(string op : ">>")(int) {}` |
| 165 |
fail_compilation/dep_d1_ops.d(376): Error: operator `>>>=` not supported for `c` of type `C` |
| 166 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opOpAssign(string op : ">>>")(int) {}` |
| 167 |
fail_compilation/dep_d1_ops.d(377): Error: operator `~=` not supported for `c` of type `C` |
| 168 |
fail_compilation/dep_d1_ops.d(225): perhaps implement `auto opOpAssign(string op : "~")(int) {}` |
| 169 |
fail_compilation/dep_d1_ops.d(386): Error: operator `~` is not defined for `NoDeprecation` |
| 170 |
fail_compilation/dep_d1_ops.d(390): perhaps overload the operator with `auto opUnary(string op : "~")() {}` |
| 171 |
--- |
| 172 |
*/ |
| 173 |
|
| 174 |
struct S |
| 175 |
{ |
| 176 |
int opAdd(int i) { return 0; } |
| 177 |
int opAdd_r(int i) { return 0; } |
| 178 |
int opSub(int i) { return 0; } |
| 179 |
int opSub_r(int i) { return 0; } |
| 180 |
int opMul(int i) { return 0; } |
| 181 |
int opMul_r(int i) { return 0; } |
| 182 |
int opDiv(int i) { return 0; } |
| 183 |
int opDiv_r(int i) { return 0; } |
| 184 |
int opMod(int i) { return 0; } |
| 185 |
int opMod_r(int i) { return 0; } |
| 186 |
|
| 187 |
int opAnd(int i) { return 0; } |
| 188 |
int opOr(int i) { return 0; } |
| 189 |
int opXor(int i) { return 0; } |
| 190 |
|
| 191 |
int opShl(int i) { return 0; } |
| 192 |
int opShl_r(int i) { return 0; } |
| 193 |
int opShr(int i) { return 0; } |
| 194 |
int opShr_r(int i) { return 0; } |
| 195 |
int opUShr(int i) { return 0; } |
| 196 |
int opUShr_r(int i) { return 0; } |
| 197 |
|
| 198 |
int opCat(int i) { return 0; } |
| 199 |
int opCat_r(int i) { return 0; } |
| 200 |
|
| 201 |
int opPos() { return 0; } |
| 202 |
int opNeg() { return 0; } |
| 203 |
int opCom() { return 0; } |
| 204 |
int opPostInc() { return 0; } |
| 205 |
int opPostDec() { return 0; } |
| 206 |
int opStar() { return 0; } |
| 207 |
|
| 208 |
int opIn(int i) { return 0; } |
| 209 |
int opIn_r(int i) { return 0; } |
| 210 |
|
| 211 |
int opAddAssign(int i) { return 0; } |
| 212 |
int opSubAssign(int i) { return 0; } |
| 213 |
int opMulAssign(int i) { return 0; } |
| 214 |
int opDivAssign(int i) { return 0; } |
| 215 |
int opModAssign(int i) { return 0; } |
| 216 |
int opAndAssign(int i) { return 0; } |
| 217 |
int opOrAssign(int i) { return 0; } |
| 218 |
int opXorAssign(int i) { return 0; } |
| 219 |
int opShlAssign(int i) { return 0; } |
| 220 |
int opShrAssign(int i) { return 0; } |
| 221 |
int opUShrAssign(int i) { return 0; } |
| 222 |
int opCatAssign(int i) { return 0; } |
| 223 |
} |
| 224 |
|
| 225 |
class C |
| 226 |
{ |
| 227 |
int opAdd(int i) { return 0; } |
| 228 |
int opAdd_r(int i) { return 0; } |
| 229 |
int opSub(int i) { return 0; } |
| 230 |
int opSub_r(int i) { return 0; } |
| 231 |
int opMul(int i) { return 0; } |
| 232 |
int opMul_r(int i) { return 0; } |
| 233 |
int opDiv(int i) { return 0; } |
| 234 |
int opDiv_r(int i) { return 0; } |
| 235 |
int opMod(int i) { return 0; } |
| 236 |
int opMod_r(int i) { return 0; } |
| 237 |
|
| 238 |
int opAnd(int i) { return 0; } |
| 239 |
int opOr(int i) { return 0; } |
| 240 |
int opXor(int i) { return 0; } |
| 241 |
|
| 242 |
int opShl(int i) { return 0; } |
| 243 |
int opShl_r(int i) { return 0; } |
| 244 |
int opShr(int i) { return 0; } |
| 245 |
int opShr_r(int i) { return 0; } |
| 246 |
int opUShr(int i) { return 0; } |
| 247 |
int opUShr_r(int i) { return 0; } |
| 248 |
|
| 249 |
int opCat(int i) { return 0; } |
| 250 |
int opCat_r(int i) { return 0; } |
| 251 |
|
| 252 |
int opPos() { return 0; } |
| 253 |
int opNeg() { return 0; } |
| 254 |
int opCom() { return 0; } |
| 255 |
int opPostInc() { return 0; } |
| 256 |
int opPostDec() { return 0; } |
| 257 |
int opStar() { return 0; } |
| 258 |
|
| 259 |
int opIn(int i) { return 0; } |
| 260 |
int opIn_r(int i) { return 0; } |
| 261 |
|
| 262 |
int opAddAssign(int i) { return 0; } |
| 263 |
int opSubAssign(int i) { return 0; } |
| 264 |
int opMulAssign(int i) { return 0; } |
| 265 |
int opDivAssign(int i) { return 0; } |
| 266 |
int opModAssign(int i) { return 0; } |
| 267 |
int opAndAssign(int i) { return 0; } |
| 268 |
int opOrAssign(int i) { return 0; } |
| 269 |
int opXorAssign(int i) { return 0; } |
| 270 |
int opShlAssign(int i) { return 0; } |
| 271 |
int opShrAssign(int i) { return 0; } |
| 272 |
int opUShrAssign(int i) { return 0; } |
| 273 |
int opCatAssign(int i) { return 0; } |
| 274 |
} |
| 275 |
|
| 276 |
void main() |
| 277 |
{ |
| 278 |
int i; |
| 279 |
{ |
| 280 |
S s; |
| 281 |
i = s + 1; |
| 282 |
i = 1 + s; |
| 283 |
i = s - 1; |
| 284 |
i = 1 - s; |
| 285 |
i = s * 1; |
| 286 |
i = 1 * s; |
| 287 |
i = s / 1; |
| 288 |
i = 1 / s; |
| 289 |
i = s % 1; |
| 290 |
i = 1 % s; |
| 291 |
|
| 292 |
i = s & 1; |
| 293 |
i = s | 1; |
| 294 |
i = s ^ 1; |
| 295 |
|
| 296 |
i = s << 1; |
| 297 |
i = 1 << s; |
| 298 |
i = s >> 1; |
| 299 |
i = 1 >> s; |
| 300 |
i = s >>> 1; |
| 301 |
i = 1 >>> s; |
| 302 |
|
| 303 |
i = s ~ 1; |
| 304 |
i = 1 ~ s; |
| 305 |
|
| 306 |
i = +s; |
| 307 |
i = -s; |
| 308 |
i = ~s; |
| 309 |
s++; |
| 310 |
s--; |
| 311 |
i = *s; |
| 312 |
|
| 313 |
i = s in 1; |
| 314 |
i = 1 in s; |
| 315 |
|
| 316 |
s += 1; |
| 317 |
s -= 1; |
| 318 |
s *= 1; |
| 319 |
s /= 1; |
| 320 |
s %= 1; |
| 321 |
s &= 1; |
| 322 |
s |= 1; |
| 323 |
s ^= 1; |
| 324 |
s <<= 1; |
| 325 |
s >>= 1; |
| 326 |
s >>>= 1; |
| 327 |
s ~= 1; |
| 328 |
} |
| 329 |
{ |
| 330 |
C c; |
| 331 |
i = c + 1; |
| 332 |
i = 1 + c; |
| 333 |
i = c - 1; |
| 334 |
i = 1 - c; |
| 335 |
i = c * 1; |
| 336 |
i = 1 * c; |
| 337 |
i = c / 1; |
| 338 |
i = 1 / c; |
| 339 |
i = c % 1; |
| 340 |
i = 1 % c; |
| 341 |
|
| 342 |
i = c & 1; |
| 343 |
i = c | 1; |
| 344 |
i = c ^ 1; |
| 345 |
|
| 346 |
i = c << 1; |
| 347 |
i = 1 << c; |
| 348 |
i = c >> 1; |
| 349 |
i = 1 >> c; |
| 350 |
i = c >>> 1; |
| 351 |
i = 1 >>> c; |
| 352 |
|
| 353 |
i = c ~ 1; |
| 354 |
i = 1 ~ c; |
| 355 |
|
| 356 |
i = +c; |
| 357 |
i = -c; |
| 358 |
i = ~c; |
| 359 |
c++; |
| 360 |
c--; |
| 361 |
i = *c; |
| 362 |
|
| 363 |
i = c in 1; |
| 364 |
i = 1 in c; |
| 365 |
|
| 366 |
c += 1; |
| 367 |
c -= 1; |
| 368 |
c *= 1; |
| 369 |
c /= 1; |
| 370 |
c %= 1; |
| 371 |
c &= 1; |
| 372 |
c |= 1; |
| 373 |
c ^= 1; |
| 374 |
c <<= 1; |
| 375 |
c >>= 1; |
| 376 |
c >>>= 1; |
| 377 |
c ~= 1; |
| 378 |
} |
| 379 |
|
| 380 |
scope nd = new NoDeprecation; |
| 381 |
assert((42 in nd) == 0); |
| 382 |
assert((nd in 42) == 0); |
| 383 |
assert((nd ~ 42) == 0); |
| 384 |
assert((42 ~ nd) == 0); |
| 385 |
|
| 386 |
~nd; |
| 387 |
} |
| 388 |
|
| 389 |
/// See https://github.com/dlang/dmd/pull/10716 |
| 390 |
class NoDeprecation |
| 391 |
{ |
| 392 |
int opIn(int i) { return 0; } |
| 393 |
int opIn_r(int i) { return 0; } |
| 394 |
int opCat(int i) { return 0; } |
| 395 |
int opCat_r(int i) { return 0; } |
| 396 |
|
| 397 |
/// This is considered because there is no `opUnary` |
| 398 |
/// However, the other overloads (`opBinary` / `opBinaryRight`) |
| 399 |
/// means that other operator overloads would not be considered. |
| 400 |
int opCom() { return 0; } |
| 401 |
|
| 402 |
int opBinary(string op)(int arg) |
| 403 |
if (op == "in" || op == "~") |
| 404 |
{ |
| 405 |
static if (op == "in") |
| 406 |
return this.opIn(arg); |
| 407 |
else static if (op == "~") |
| 408 |
return this.opCat(arg); |
| 409 |
} |
| 410 |
|
| 411 |
int opBinaryRight(string op)(int arg) |
| 412 |
if (op == "in" || op == "~") |
| 413 |
{ |
| 414 |
static if (op == "in") |
| 415 |
return this.opIn_r(arg); |
| 416 |
else static if (op == "~") |
| 417 |
return this.opCat_r(arg); |
| 418 |
} |
| 419 |
} |