/// parameter of the given member function (@c Method) from the
/// expression @p From.
static ImplicitConversionSequence
-TryObjectArgumentInitialization(Sema &S, QualType OrigFromType,
+TryObjectArgumentInitialization(Sema &S, QualType FromType,
Expr::Classification FromClassification,
CXXMethodDecl *Method,
CXXRecordDecl *ActingContext) {
ImplicitConversionSequence ICS;
// We need to have an object of class type.
- QualType FromType = OrigFromType;
if (const PointerType *PT = FromType->getAs<PointerType>()) {
FromType = PT->getPointeeType();
!= FromTypeCanon.getLocalCVRQualifiers() &&
!ImplicitParamType.isAtLeastAsQualifiedAs(FromTypeCanon)) {
ICS.setBad(BadConversionSequence::bad_qualifiers,
- OrigFromType, ImplicitParamType);
+ FromType, ImplicitParamType);
return ICS;
}
}
}
+namespace b7398190 {
+ struct S {
+ int f(); // expected-note {{'this' argument has type 'const b7398190::S', but method is not marked const}}
+ void f(int); // expected-note {{requires 1 argument, but 0 were provided}}
+ };
+ const S *p;
+ int k = p->f(); // expected-error {{no matching member function for call to 'f'}}
+}