diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/SemaCXX/default2.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/SemaCXX/default2.cpp b/test/SemaCXX/default2.cpp index f99e45415d..edbd6b3e20 100644 --- a/test/SemaCXX/default2.cpp +++ b/test/SemaCXX/default2.cpp @@ -115,9 +115,15 @@ void test_Z(const Z& z) { } struct ZZ { - void f(ZZ z = g()); // expected-error{{no matching constructor for initialization}} - static ZZ g(int = 17); + void f(ZZ z = g()); // expected-error{{no matching constructor for initialization}} + ZZ(ZZ&, int = 17); // expected-note{{candidate function}} }; + +// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#325 +class C2 { + static void g(int = f()); // expected-error{{use of default argument to function 'f' that is declared later in class 'C2'}} + static int f(int = 10); // expected-note{{default argument declared here}} +}; |