}
if (!Context.hasSameUnqualifiedType(Class, LType)) {
+ // If we want to check the hierarchy, we need a complete type.
+ if (RequireCompleteType(Loc, LType, PDiag(diag::err_bad_memptr_lhs)
+ << OpSpelling << (int)isIndirect)) {
+ return QualType();
+ }
CXXBasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/false,
/*DetectVirtual=*/false);
// FIXME: Would it be useful to print full ambiguity paths, or is that
}
};
}
+
+namespace pr6783 {
+ struct Base {};
+ struct X; // expected-note {{forward declaration}}
+
+ int test1(int Base::* p2m, X* object)
+ {
+ return object->*p2m; // expected-error {{left hand operand to ->*}}
+ }
+}