diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2011-02-17 17:30:05 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-02-17 17:30:05 +0000 |
| commit | 5fc74804a61ac36f261349da8f4b0481da18298e (patch) | |
| tree | a61bf30a7431a920c05b9aafeb049e5feee36f84 | |
| parent | a991f3a4e9151c4dc24f3d0902a7686d8febcd31 (diff) | |
| download | bcm5719-llvm-5fc74804a61ac36f261349da8f4b0481da18298e.tar.gz bcm5719-llvm-5fc74804a61ac36f261349da8f4b0481da18298e.zip | |
Improve diagnostics on missing property decl.
llvm-svn: 125752
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 3 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 2 | ||||
| -rw-r--r-- | clang/test/SemaObjC/property-missing.m | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index d6840903e3b..e9df286d2d2 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -2580,7 +2580,8 @@ def err_getter_not_found : Error< def err_property_not_found_forward_class : Error< "property %0 cannot be found in forward class object %1">; def err_property_not_as_forward_class : Error< - "property %0 names an object of forward class type in class object %1">; + "property %0 refers to an incomplete Objective-C class %1 " + "(with no @interface available)">; def note_forward_class : Note< "forward class is declared here">; def err_duplicate_property : Error< diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index c41327e2846..4d03b068ca8 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -530,7 +530,7 @@ HandleExprPropertyRefExpr(const ObjCObjectPointerType *OPT, if (ObjCInterfaceDecl *IFace = IFaceT->getDecl()) if (IFace->isForwardDecl()) { Diag(MemberLoc, diag::err_property_not_as_forward_class) - << MemberName << QualType(OPT, 0); + << MemberName << IFace; Diag(IFace->getLocation(), diag::note_forward_class); return ExprError(); } diff --git a/clang/test/SemaObjC/property-missing.m b/clang/test/SemaObjC/property-missing.m index 6b794fb02f3..bf75601b79b 100644 --- a/clang/test/SemaObjC/property-missing.m +++ b/clang/test/SemaObjC/property-missing.m @@ -29,6 +29,6 @@ void f3(id o) @end void foo(MyClass *myObject) { - myObject.someOtherObject.someProperty = 0; // expected-error {{property 'someOtherObject' names an object of forward class type in class object 'MyClass *'}} + myObject.someOtherObject.someProperty = 0; // expected-error {{property 'someOtherObject' refers to an incomplete Objective-C class 'SomeOtherClass' (with no @interface available)}} } |

