diff options
-rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.def | 3 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 5 | ||||
-rw-r--r-- | clang/test/SemaObjC/property-nonfragile-abi.m | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.def b/clang/include/clang/Basic/DiagnosticSemaKinds.def index 2d751ad8afb..4d711f72133 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.def +++ b/clang/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/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index d90f2adc77a..476b6afea57 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/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/clang/test/SemaObjC/property-nonfragile-abi.m b/clang/test/SemaObjC/property-nonfragile-abi.m index 4a211bd2401..28ad942b59c 100644 --- a/clang/test/SemaObjC/property-nonfragile-abi.m +++ b/clang/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 |