// First check the qualifiers. We don't care about lvalue-vs-rvalue
// with the implicit object parameter (C++ [over.match.funcs]p5).
QualType FromTypeCanon = Context.getCanonicalType(FromType);
- if (ImplicitParamType.getCVRQualifiers() != FromType.getCVRQualifiers() &&
- !ImplicitParamType.isAtLeastAsQualifiedAs(FromType))
+ if (ImplicitParamType.getCVRQualifiers() != FromTypeCanon.getCVRQualifiers() &&
+ !ImplicitParamType.isAtLeastAsQualifiedAs(FromTypeCanon))
return ICS;
// Check that we have either the same type or a derived type. It
X::h(0); // expected-error{{call to non-static member function without an object argument}}
}
+
+struct X1 {
+ int& member();
+ float& member() const;
+};
+
+struct X2 : X1 { };
+
+void test_X2(X2 *x2p, const X2 *cx2p) {
+ int &ir = x2p->member();
+ float &fr = cx2p->member();
+}
(void)f0<0>();
}
};
+
+// Fun with template instantiation and conversions
+struct X4 {
+ int& member();
+ float& member() const;
+};
+
+template<typename T>
+struct X5 {
+ void f(T* ptr) { int& ir = ptr->member(); }
+ void g(T* ptr) { float& fr = ptr->member(); }
+};
+
+void test_X5(X5<X4> x5, X5<const X4> x5c, X4 *xp, const X4 *cxp) {
+ x5.f(xp);
+ x5c.g(cxp);
+}