34 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3class C { 4public:5 void f(int i = 3); // expected-note{{here}}6 void g(int i, int j = 99);7};8 9void C::f(int i = 3) { } // expected-error{{redefinition of default argument}}10 11void C::g(int i = 88, int j) { }12 13void test_C(C c) {14 c.f();15 c.g();16}17 18template<typename T>19struct X0 {20 void f(int);21 22 struct Inner {23 void g(int);24 };25};26 27// DR21728template<typename T>29void X0<T>::f(int = 17) { } // expected-error{{cannot be added}}30 31// DR217 + DR205 (reading tea leaves)32template<typename T>33void X0<T>::Inner::g(int = 17) { } // expected-error{{cannot be added}}34