comparison clang/test/SemaCXX/overload-member-call.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
comparison
equal deleted inserted replaced
173:0572611fdcc8 207:2e18cbf3894f
81 void bar(int i); //expected-note {{candidate function not viable: 'this' argument has type 'const test1::A', but method is not marked const}} 81 void bar(int i); //expected-note {{candidate function not viable: 'this' argument has type 'const test1::A', but method is not marked const}}
82 82
83 void baz(A &d); // expected-note {{candidate function not viable: 1st argument ('const test1::A') would lose const qualifier}} 83 void baz(A &d); // expected-note {{candidate function not viable: 1st argument ('const test1::A') would lose const qualifier}}
84 void baz(int i); // expected-note {{candidate function not viable: no known conversion from 'const test1::A' to 'int' for 1st argument}} 84 void baz(int i); // expected-note {{candidate function not viable: no known conversion from 'const test1::A' to 'int' for 1st argument}}
85 85
86 void ref() &&; // expected-note {{expects an rvalue for object argument}} expected-note {{requires 0 arguments, but 1 was provided}}
87 void ref(int) &; // expected-note {{expects an lvalue for object argument}} expected-note {{requires 1 argument, but 0 were provided}}
88
86 // PR 11857 89 // PR 11857
87 void foo(int n); // expected-note {{candidate function not viable: requires single argument 'n', but 2 arguments were provided}} 90 void foo(int n); // expected-note {{candidate function not viable: requires single argument 'n', but 2 arguments were provided}}
88 void foo(unsigned n = 10); // expected-note {{candidate function not viable: allows at most single argument 'n', but 2 arguments were provided}} 91 void foo(unsigned n = 10); // expected-note {{candidate function not viable: allows at most single argument 'n', but 2 arguments were provided}}
89 void rab(double n, int u = 0); // expected-note {{candidate function not viable: requires at least argument 'n', but no arguments were provided}} 92 void rab(double n, int u = 0); // expected-note {{candidate function not viable: requires at least argument 'n', but no arguments were provided}}
90 void rab(int n, int u = 0); // expected-note {{candidate function not viable: requires at least argument 'n', but no arguments were provided}} 93 void rab(int n, int u = 0); // expected-note {{candidate function not viable: requires at least argument 'n', but no arguments were provided}}
101 104
102 a.baz(b); //expected-error {{no matching member function for call to 'baz'}} 105 a.baz(b); //expected-error {{no matching member function for call to 'baz'}}
103 106
104 a.rab(); //expected-error {{no matching member function for call to 'rab'}} 107 a.rab(); //expected-error {{no matching member function for call to 'rab'}}
105 a.zab(3, 4, 5); //expected-error {{no matching member function for call to 'zab'}} 108 a.zab(3, 4, 5); //expected-error {{no matching member function for call to 'zab'}}
109
110 a.ref(); // expected-error {{no matching member function for call to 'ref'}}
111 A().ref(1); // expected-error {{no matching member function for call to 'ref'}}
106 } 112 }
107 } 113 }
108 114
109 namespace b7398190 { 115 namespace b7398190 {
110 struct S { 116 struct S {