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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66162 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Basic/DiagnosticSemaKinds.def b/include/clang/Basic/DiagnosticSemaKinds.def
index 2d751ad..4d711f7 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.def
+++ b/include/clang/Basic/DiagnosticSemaKinds.def
@@ -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,
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index d90f2ad..476b6af 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -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;
     }
diff --git a/test/SemaObjC/property-nonfragile-abi.m b/test/SemaObjC/property-nonfragile-abi.m
index 4a211bd..28ad942 100644
--- a/test/SemaObjC/property-nonfragile-abi.m
+++ b/test/SemaObjC/property-nonfragile-abi.m
@@ -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