[cfe-commits] r60562 - in /cfe/trunk: include/clang/Basic/DiagnosticKinds.def lib/Sema/SemaDeclObjC.cpp test/SemaObjC/continuation-class-err.m

Fariborz Jahanian fjahanian at apple.com
Thu Dec 4 14:56:16 PST 2008


Author: fjahanian
Date: Thu Dec  4 16:56:16 2008
New Revision: 60562

URL: http://llvm.org/viewvc/llvm-project?rev=60562&view=rev
Log:
Output better diagnostics for continuation class
property attribute mis-specification.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticKinds.def
    cfe/trunk/lib/Sema/SemaDeclObjC.cpp
    cfe/trunk/test/SemaObjC/continuation-class-err.m

Modified: cfe/trunk/include/clang/Basic/DiagnosticKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticKinds.def?rev=60562&r1=60561&r2=60562&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticKinds.def (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticKinds.def Thu Dec  4 16:56:16 2008
@@ -566,7 +566,7 @@
 DIAG(err_continuation_class, ERROR,
      "continuation class has no primary class")
 DIAG(err_use_continuation_class, ERROR,
-     "use contination class to override 'readonly' property with 'readwrite'")
+     "attribute of property in continuation class of %0 can only  be 'readwrite'")
 DIAG(warn_property_attr_mismatch, WARNING,
      "property attribute in continuation class does not match the primary class")
 DIAG(err_accessor_property_type_mismatch, ERROR,

Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=60562&r1=60561&r2=60562&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Thu Dec  4 16:56:16 2008
@@ -1283,7 +1283,7 @@
             PIDecl->setSetterMethodDecl(SetterDecl);
           }
           else
-            Diag(AtLoc, diag::err_use_continuation_class);
+            Diag(AtLoc, diag::err_use_continuation_class) << ICDecl->getDeclName();
           *isOverridingProperty = true;
           return 0;
         }

Modified: cfe/trunk/test/SemaObjC/continuation-class-err.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/continuation-class-err.m?rev=60562&r1=60561&r2=60562&view=diff

==============================================================================
--- cfe/trunk/test/SemaObjC/continuation-class-err.m (original)
+++ cfe/trunk/test/SemaObjC/continuation-class-err.m Thu Dec  4 16:56:16 2008
@@ -11,5 +11,5 @@
 
 @interface ReadOnly ()
 @property(readwrite, copy) id object;	// expected-warning {{property attribute in continuation class does not match the primary class}}
- at property(readonly) id object1; // expected-error {{use contination class to override 'readonly' property with 'readwrite'}}
+ at property(readonly) id object1; // expected-error {{attribute of property in continuation class of 'ReadOnly' can only  be 'readwrite'}}
 @end





More information about the cfe-commits mailing list