|
| 1 | +// This test makes sure overloaded operators for tag `bool:` don't trigger |
| 2 | +// warning 247. The code in 'main()' is copied from file "warning_247.pwn", |
| 3 | +// but with the lines that test operators `<<`, `>>`, `>>>` and `~` removed, |
| 4 | +// as shift operators can't be overloaded and `~` is reserved for destructors. |
| 5 | + |
| 6 | +bool:operator -(bool:oper) return oper; |
| 7 | +bool:operator ++(bool:oper) return oper; |
| 8 | +bool:operator --(bool:oper) return oper; |
| 9 | +bool:operator *(bool:oper1, bool:oper2) return oper1,oper2; |
| 10 | +bool:operator /(bool:oper1, bool:oper2) return oper1,oper2; |
| 11 | +bool:operator %(bool:oper1, bool:oper2) return oper1,oper2; |
| 12 | +bool:operator +(bool:oper1, bool:oper2) return oper1,oper2; |
| 13 | +bool:operator -(bool:oper1, bool:oper2) return oper1,oper2; |
| 14 | +bool:operator <=(bool:oper1, bool:oper2) return oper1,oper2; |
| 15 | +bool:operator >=(bool:oper1, bool:oper2) return oper1,oper2; |
| 16 | +bool:operator <(bool:oper1, bool:oper2) return oper1,oper2; |
| 17 | +bool:operator >(bool:oper1, bool:oper2) return oper1,oper2; |
| 18 | + |
| 19 | +main() |
| 20 | +{ |
| 21 | + new bool:a = true, bool:b = false; |
| 22 | + if (a <= b) {} |
| 23 | + if (a >= b) {} |
| 24 | + if (a < b) {} |
| 25 | + if (a > b) {} |
| 26 | + if (-a) {} |
| 27 | + if (++a) {} |
| 28 | + if (a++) {} |
| 29 | + if (--a) {} |
| 30 | + if (a--) {} |
| 31 | + if (a * b) {} |
| 32 | + if (a / b) {} |
| 33 | + if (a % b) {} |
| 34 | + if (a + b) {} |
| 35 | + if (a - b) {} |
| 36 | +} |
0 commit comments