gcc/testsuite/g++.dg/parse/functor1.C
raw| 1 | // PR c++/64679 |
| 2 | // { dg-do run } |
| 3 | |
| 4 | struct F { |
| 5 | F(int) { } |
| 6 | F(int, int) { } |
| 7 | F operator()(int) const { return *this; } |
| 8 | F operator()(int, int) const { return *this; } |
| 9 | }; |
| 10 | |
| 11 | int main() |
| 12 | { |
| 13 | // Init-declarators. |
| 14 | int i = 0; |
| 15 | int (j)(1); |
| 16 | // None of these is an init-declarator. |
| 17 | F(i)(1)(2); |
| 18 | F(i)(1, 2)(3); |
| 19 | F(i)(1)(2, 3); |
| 20 | F(i)(2)(3)(4)(5); |
| 21 | F(i, j)(1)(2)(3)(4)(5)(6); |
| 22 | } |