PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / parse / pr34758.C
blobd694853e68e8c29114546cdd07933694915b5380
1 // PR 34758 Bad diagnostic for circular dependency in constructor default argument
2 // { dg-do compile }
3 // { dg-options "" }
4 struct A
6   A (const A& = A()); // { dg-error "recursive evaluation of default argument" }
7 };
10 struct S {
11   S(const S& = f()); // { dg-error "default argument\[^\n\]*which is not yet defined" }
12   static const S& f(int i = 3);
15 struct J {
16   J(const J& = f(2)); // { dg-error "default argument.*which is not yet defined" }
17   static const J& f(int i = 3, int j = 4);
20 struct Z {
21   Z(const Z& = f(4));
22   static const Z& f(int i = 3);
25 struct X {
26   X(const X& = g());
27   static const X& g(void);