[cfe-commits] r125752 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaExprObjC.cpp test/SemaObjC/property-missing.m

Fariborz Jahanian fjahanian at apple.com
Thu Feb 17 09:30:05 PST 2011


Author: fjahanian
Date: Thu Feb 17 11:30:05 2011
New Revision: 125752

URL: http://llvm.org/viewvc/llvm-project?rev=125752&view=rev
Log:
Improve diagnostics on missing property decl.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/lib/Sema/SemaExprObjC.cpp
    cfe/trunk/test/SemaObjC/property-missing.m

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=125752&r1=125751&r2=125752&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Feb 17 11:30:05 2011
@@ -2580,7 +2580,8 @@
 def err_property_not_found_forward_class : Error<
   "property %0 cannot be found in forward class object %1">;
 def err_property_not_as_forward_class : Error<
-  "property %0 names an object of forward class type in class object %1">;
+  "property %0 refers to an incomplete Objective-C class %1 "
+  "(with no @interface available)">;
 def note_forward_class : Note<
   "forward class is declared here">;
 def err_duplicate_property : Error<

Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=125752&r1=125751&r2=125752&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Thu Feb 17 11:30:05 2011
@@ -530,7 +530,7 @@
       if (ObjCInterfaceDecl *IFace = IFaceT->getDecl())
         if (IFace->isForwardDecl()) {
           Diag(MemberLoc, diag::err_property_not_as_forward_class)
-          << MemberName << QualType(OPT, 0);
+          << MemberName << IFace;
           Diag(IFace->getLocation(), diag::note_forward_class);
           return ExprError();
         }

Modified: cfe/trunk/test/SemaObjC/property-missing.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-missing.m?rev=125752&r1=125751&r2=125752&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/property-missing.m (original)
+++ cfe/trunk/test/SemaObjC/property-missing.m Thu Feb 17 11:30:05 2011
@@ -29,6 +29,6 @@
 @end
 
 void foo(MyClass *myObject) {
-	myObject.someOtherObject.someProperty = 0; // expected-error {{property 'someOtherObject' names an object of forward class type in class object 'MyClass *'}}
+	myObject.someOtherObject.someProperty = 0; // expected-error {{property 'someOtherObject' refers to an incomplete Objective-C class 'SomeOtherClass' (with no @interface available)}}
 }
 





More information about the cfe-commits mailing list