1 // RUN: %clang_cc1 -fsyntax-only -verify %s -Wnon-pod-varargs
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s -Wnon-pod-varargs
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s -Wnon-pod-varargs
5 class X
{ }; // expected-note {{the implicit copy constructor}}
6 // expected-note@-1 {{the implicit default constructor}}
7 #if __cplusplus >= 201103L // C++11 or later
8 // expected-note@-3 {{candidate constructor (the implicit move constructor) not viable}}
11 int& copycon(X x
); // expected-note{{passing argument to parameter}}
14 void test_copycon(X x
, X
const xc
, X
volatile xv
) {
16 int& i2
= copycon(xc
);
17 copycon(xv
); // expected-error{{no matching constructor}}
22 A(A
&); // expected-note{{would lose const qualifier}} \
23 // expected-note{{no known conversion}}
26 class B
: public A
{ }; // expected-note{{would lose const qualifier}} \
27 // expected-note{{would lose volatile qualifier}} \
28 // expected-note 2{{requires 0 arguments}}
30 short& copycon2(A a
); // expected-note{{passing argument to parameter}}
31 int& copycon2(B b
); // expected-note 2{{passing argument to parameter}}
34 void test_copycon2(A a
, const A ac
, B b
, B
const bc
, B
volatile bv
) {
35 int& i1
= copycon2(b
);
36 copycon2(bc
); // expected-error{{no matching constructor}}
37 copycon2(bv
); // expected-error{{no matching constructor}}
38 short& s1
= copycon2(a
);
39 copycon2(ac
); // expected-error{{no matching constructor}}
42 int& copycon3(A a
); // expected-note{{passing argument to parameter 'a' here}}
45 void test_copycon3(B b
, const B bc
) {
46 int& i1
= copycon3(b
);
47 copycon3(bc
); // expected-error{{no matching constructor}}
50 class C
: public B
{ };
55 void test_copycon4(C c
) {