"lookup in the object type %0 refers here">;
def note_ambig_member_ref_scope : Note<
"lookup from the current scope refers here">;
+def err_qualified_member_nonclass : Error<
+ "qualified member access refers to a member in %0">;
// C++ class members
def err_storageclass_invalid_for_member : Error<
// If the member name was a qualified-id, look into the
// nested-name-specifier.
DC = computeDeclContext(*SS, false);
+
+ if (!isa<TypeDecl>(DC)) {
+ Diag(MemberLoc, diag::err_qualified_member_nonclass)
+ << DC << SS->getRange();
+ return ExprError();
+ }
// FIXME: If DC is not computable, we should build a
// CXXUnresolvedMemberExpr.
return b->f0->f0; // expected-error{{member reference base type 'struct A *()' is not a structure or union}} \
// expected-note{{perhaps you meant to call this function}}
}
+
+int i;
+
+namespace C {
+ int i;
+}
+
+void test2(X *xp) {
+ xp->::i = 7; // expected-error{{qualified member access refers to a member in the global namespace}}
+ xp->C::i = 7; // expected-error{{qualified member access refers to a member in namespace 'C'}}
+}