Output better diagnostics for continuation class
property attribute mis-specification.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60562 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Basic/DiagnosticKinds.def b/include/clang/Basic/DiagnosticKinds.def
index e48de86..2fd6ac5 100644
--- a/include/clang/Basic/DiagnosticKinds.def
+++ b/include/clang/Basic/DiagnosticKinds.def
@@ -566,7 +566,7 @@
DIAG(err_continuation_class, ERROR,
"continuation class has no primary class")
DIAG(err_use_continuation_class, ERROR,
- "use contination class to override 'readonly' property with 'readwrite'")
+ "attribute of property in continuation class of %0 can only be 'readwrite'")
DIAG(warn_property_attr_mismatch, WARNING,
"property attribute in continuation class does not match the primary class")
DIAG(err_accessor_property_type_mismatch, ERROR,
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index ed87516..b3afd78 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1283,7 +1283,7 @@
PIDecl->setSetterMethodDecl(SetterDecl);
}
else
- Diag(AtLoc, diag::err_use_continuation_class);
+ Diag(AtLoc, diag::err_use_continuation_class) << ICDecl->getDeclName();
*isOverridingProperty = true;
return 0;
}
diff --git a/test/SemaObjC/continuation-class-err.m b/test/SemaObjC/continuation-class-err.m
index 1d4725f..321615e 100644
--- a/test/SemaObjC/continuation-class-err.m
+++ b/test/SemaObjC/continuation-class-err.m
@@ -11,5 +11,5 @@
@interface ReadOnly ()
@property(readwrite, copy) id object; // expected-warning {{property attribute in continuation class does not match the primary class}}
-@property(readonly) id object1; // expected-error {{use contination class to override 'readonly' property with 'readwrite'}}
+@property(readonly) id object1; // expected-error {{attribute of property in continuation class of 'ReadOnly' can only be 'readwrite'}}
@end