gcc/testsuite/g++.dg/parse/ambig2.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | // Copyright (C) 2003 Free Software Foundation, Inc. |
| 4 | // Contributed by Nathan Sidwell 6 Jan 2003 <[email protected]> |
| 5 | |
| 6 | // PR 9212. We erroneously accepted an ill-formed |
| 7 | // function-declaration, rather than a variable initializer. |
| 8 | |
| 9 | |
| 10 | struct A |
| 11 | { |
| 12 | enum E { e }; |
| 13 | A(E); |
| 14 | }; |
| 15 | |
| 16 | struct B |
| 17 | { |
| 18 | enum F { f }; |
| 19 | B(F); |
| 20 | }; |
| 21 | |
| 22 | struct C |
| 23 | { |
| 24 | C(A, B, A); |
| 25 | }; |
| 26 | |
| 27 | C c(A(A::e), B(B::f), A(A::e)); // This is not a function declaration |