[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / clang / test / SemaCXX / overload-call-copycon.cpp
blob84971024acd82987960a3a471d23ad3444e81456
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}}
9 #endif
11 int& copycon(X x); // expected-note{{passing argument to parameter}}
12 float& copycon(...);
14 void test_copycon(X x, X const xc, X volatile xv) {
15 int& i1 = copycon(x);
16 int& i2 = copycon(xc);
17 copycon(xv); // expected-error{{no matching constructor}}
20 class A {
21 public:
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}}
32 float& copycon2(...);
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}}
43 float& copycon3(...);
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 { };
52 float& copycon4(A a);
53 int& copycon4(B b);
55 void test_copycon4(C c) {
56 int& i = copycon4(c);