blob: 9ab0b489a2c4584cabdbcf1005a2435c9b1a1fac [file] [log] [blame]
Shih-wei Liaoea285162010-06-04 12:34:56 -07001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
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// DR217
28template<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}}