From: Steve Naroff Date: Thu, 5 Mar 2009 15:45:01 +0000 (+0000) Subject: Tweak diag for [clang on xcode] (using arch=x86_64): synthes... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fbffca65a95e26b198c084a81a33b9cdfcd01101;p=clang Tweak diag for [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 2d751ad8af..4d711f7213 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.def +++ b/include/clang/Basic/DiagnosticSemaKinds.def @@ -213,6 +213,9 @@ DIAG(error_bad_property_context, ERROR, 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 d90f2adc77..476b6afea5 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1757,7 +1757,10 @@ Sema::DeclTy *Sema::ActOnPropertyImplDecl(SourceLocation AtLoc, // 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 4a211bd240..28ad942b59 100644 --- a/test/SemaObjC/property-nonfragile-abi.m +++ b/test/SemaObjC/property-nonfragile-abi.m @@ -16,7 +16,7 @@ typedef signed char BOOL; @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