[cfe-commits] r66162 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.def lib/Sema/SemaDeclObjC.cpp test/SemaObjC/property-nonfragile-abi.m

Steve Naroff snaroff at apple.com
Thu Mar 5 07:45:06 PST 2009


Author: snaroff
Date: Thu Mar  5 09:45:01 2009
New Revision: 66162

URL: http://llvm.org/viewvc/llvm-project?rev=66162&view=rev
Log:
Tweak diag for <rdar://problem/5982579> [clang on xcode] (using arch=x86_64): synthesized property 'sdkPath' must either be named the same as a compatible ivar or must explicitly name an ivar.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.def
    cfe/trunk/lib/Sema/SemaDeclObjC.cpp
    cfe/trunk/test/SemaObjC/property-nonfragile-abi.m

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

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.def (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.def Thu Mar  5 09:45:01 2009
@@ -213,6 +213,9 @@
 DIAG(error_missing_property_ivar_decl, ERROR,
      "synthesized property %0 must either be named the same as a compatible"
      " ivar or must explicitly name an ivar")
+DIAG(error_synthesized_ivar_yet_not_supported, ERROR,
+     "instance variable synthesis not yet supported"
+     " (need to declare %0 explicitly)")
 DIAG(error_property_ivar_type, ERROR,
      "type of property %0 does not match type of ivar %1") 
 DIAG(error_weak_property, ERROR,

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Thu Mar  5 09:45:01 2009
@@ -1757,7 +1757,10 @@
     // Check that this is a previously declared 'ivar' in 'IDecl' interface
     Ivar = IDecl->lookupInstanceVariable(PropertyIvar);
     if (!Ivar) {
-      if (!getLangOptions().ObjCNonFragileABI)
+      if (getLangOptions().ObjCNonFragileABI)
+        Diag(PropertyLoc, diag::error_synthesized_ivar_yet_not_supported) 
+                          << PropertyId;
+      else
         Diag(PropertyLoc, diag::error_missing_property_ivar_decl) << PropertyId;
       return 0;
     }

Modified: cfe/trunk/test/SemaObjC/property-nonfragile-abi.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-nonfragile-abi.m?rev=66162&r1=66161&r2=66162&view=diff

==============================================================================
--- cfe/trunk/test/SemaObjC/property-nonfragile-abi.m (original)
+++ cfe/trunk/test/SemaObjC/property-nonfragile-abi.m Thu Mar  5 09:45:01 2009
@@ -16,7 +16,7 @@
 @end
 
 @implementation XCDeviceWillExecuteInfoBaton
-  // No error is produced with compiling for -arch x86_64 (or "non-fragile" ABI)
-  @synthesize sdkPath;
+  // Produce an error when compiling for -arch x86_64 (or "non-fragile" ABI)
+  @synthesize sdkPath; // expected-error{{instance variable synthesis not yet supported (need to declare 'sdkPath' explicitly)}}
 @end
 





More information about the cfe-commits mailing list