blob: 790208aa1d050a93eb8dd8e3700465190d7e67f2 [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang_cc1 -fsyntax-only -verify %s
2void f(int i);
3void f(int i = 0); // expected-note {{previous definition is here}}
4void f(int i = 17); // expected-error {{redefinition of default argument}}
5
6
7void g(int i, int j, int k = 3);
8void g(int i, int j = 2, int k);
9void g(int i = 1, int j, int k);
10
11void h(int i, int j = 2, int k = 3,
12 int l, // expected-error {{missing default argument on parameter 'l'}}
13 int, // expected-error {{missing default argument on parameter}}
14 int n);// expected-error {{missing default argument on parameter 'n'}}
15
16struct S { } s;
17void i(int = s) { } // expected-error {{no viable conversion}}
18
19struct X {
20 X(int);
21};
22
23void j(X x = 17);
24
25struct Y { // expected-note 2{{candidate}}
26 explicit Y(int);
27};
28
29void k(Y y = 17); // expected-error{{no viable conversion}}
30
31void kk(Y = 17); // expected-error{{no viable conversion}}