// Handle ivar access to Objective-C objects.
if (const ObjCObjectType *OTy = BaseType->getAs<ObjCObjectType>()) {
- if (!SS.isEmpty()) {
+ if (!SS.isEmpty() && !SS.isInvalid()) {
Diag(SS.getRange().getBegin(), diag::err_qualified_objc_access)
<< 1 << SS.getScopeRep()
<< FixItHint::CreateRemoval(SS.getRange());
// Objective-C property access.
const ObjCObjectPointerType *OPT;
if (!IsArrow && (OPT = BaseType->getAs<ObjCObjectPointerType>())) {
- if (!SS.isEmpty()) {
+ if (!SS.isEmpty() && !SS.isInvalid()) {
Diag(SS.getRange().getBegin(), diag::err_qualified_objc_access)
<< 0 << SS.getScopeRep()
<< FixItHint::CreateRemoval(SS.getRange());
void testD(D *d) {
d.Forward::property = 17; // expected-error{{property access cannot be qualified with 'Forward::'}}
d->Forward::ivar = 12; // expected-error{{ivar access cannot be qualified with 'Forward::'}}
+ d.D::property = 17; // expected-error{{expected a class or namespace}}
+ d->D::ivar = 12; // expected-error{{expected a class or namespace}}
}