diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2008-04-21 21:57:36 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-04-21 21:57:36 +0000 |
| commit | c6bec7b6dc41b13ee9c4eae5e183c2cccc34f443 (patch) | |
| tree | a3cd9590275846bc40d0dbfed328e34b7f6bc24d /clang/lib/Sema/SemaDeclObjC.cpp | |
| parent | f386da0aec8d126ea09dc532c0442444aa77c5a6 (diff) | |
| download | bcm5719-llvm-c6bec7b6dc41b13ee9c4eae5e183c2cccc34f443.tar.gz bcm5719-llvm-c6bec7b6dc41b13ee9c4eae5e183c2cccc34f443.zip | |
More semantics checks of properties. Property implementation can implicitly use
ivar of same name.
Better diagnostics to bring home this point.
llvm-svn: 50065
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 45d87777856..234bead575e 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -998,14 +998,13 @@ Sema::DeclTy *Sema::ActOnPropertyImplDecl(SourceLocation AtLoc, // Check that we have a valid, previously declared ivar for @synthesize if (Synthesize) { // @synthesize - if (!PropertyIvar) { - Diag(PropertyLoc, diag::error_property_ivar_decl); - return 0; - } + if (!PropertyIvar) + PropertyIvar = PropertyId; // Check that this is a previously declared 'ivar' in 'IDecl' interface ObjCIvarDecl *Ivar = IDecl->FindIvarDeclaration(PropertyIvar); if (!Ivar) { - Diag(PropertyLoc, diag::error_missing_property_ivar_decl); + Diag(PropertyLoc, diag::error_missing_property_ivar_decl, + PropertyId->getName()); return 0; } // Check that type of property and its ivar match. |

