[cfe-commits] r141544 - in /cfe/trunk: lib/Sema/SemaExprMember.cpp test/SemaObjCXX/propert-dot-error.mm
Douglas Gregor
dgregor at apple.com
Mon Oct 10 09:09:49 PDT 2011
Author: dgregor
Date: Mon Oct 10 11:09:49 2011
New Revision: 141544
URL: http://llvm.org/viewvc/llvm-project?rev=141544&view=rev
Log:
Don't complain about qualified property or ivar access when the
qualifier itself is invalid. Crasher noticed by Fariborz.
Modified:
cfe/trunk/lib/Sema/SemaExprMember.cpp
cfe/trunk/test/SemaObjCXX/propert-dot-error.mm
Modified: cfe/trunk/lib/Sema/SemaExprMember.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprMember.cpp?rev=141544&r1=141543&r2=141544&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprMember.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprMember.cpp Mon Oct 10 11:09:49 2011
@@ -1045,7 +1045,7 @@
// 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());
@@ -1170,7 +1170,7 @@
// 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());
Modified: cfe/trunk/test/SemaObjCXX/propert-dot-error.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/propert-dot-error.mm?rev=141544&r1=141543&r2=141544&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/propert-dot-error.mm (original)
+++ cfe/trunk/test/SemaObjCXX/propert-dot-error.mm Mon Oct 10 11:09:49 2011
@@ -64,4 +64,6 @@
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}}
}
More information about the cfe-commits
mailing list