r198049 - Parameterizing some MS property-related diagnostics. No functional changes intended.
Aaron Ballman
aaron at aaronballman.com
Thu Dec 26 07:46:39 PST 2013
Author: aaronballman
Date: Thu Dec 26 09:46:38 2013
New Revision: 198049
URL: http://llvm.org/viewvc/llvm-project?rev=198049&view=rev
Log:
Parameterizing some MS property-related diagnostics. No functional changes intended.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaPseudoObject.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=198049&r1=198048&r2=198049&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Dec 26 09:46:38 2013
@@ -1950,14 +1950,10 @@ def err_anonymous_property: Error<
"anonymous property is not supported">;
def err_property_is_variably_modified: Error<
"property '%0' has a variably modified type">;
-def err_no_getter_for_property : Error<
- "no getter defined for property '%0'">;
-def err_no_setter_for_property : Error<
- "no setter defined for property '%0'">;
-def error_cannot_find_suitable_getter : Error<
- "cannot find suitable getter for property '%0'">;
-def error_cannot_find_suitable_setter : Error<
- "cannot find suitable setter for property '%0'">;
+def err_no_getter_setter_for_property : Error<
+ "no %select{getter|setter}0 defined for property '%1'">;
+def error_cannot_find_suitable_getter_setter : Error<
+ "cannot find suitable %select{getter|setter}0 for property '%1'">;
def err_attribute_aligned_not_power_of_two : Error<
"requested alignment is not a power of 2">;
Modified: cfe/trunk/lib/Sema/SemaPseudoObject.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaPseudoObject.cpp?rev=198049&r1=198048&r2=198049&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaPseudoObject.cpp (original)
+++ cfe/trunk/lib/Sema/SemaPseudoObject.cpp Thu Dec 26 09:46:38 2013
@@ -1393,8 +1393,8 @@ Expr *MSPropertyOpBuilder::rebuildAndCap
ExprResult MSPropertyOpBuilder::buildGet() {
if (!RefExpr->getPropertyDecl()->hasGetter()) {
- S.Diag(RefExpr->getMemberLoc(), diag::err_no_getter_for_property)
- << RefExpr->getPropertyDecl()->getName();
+ S.Diag(RefExpr->getMemberLoc(), diag::err_no_getter_setter_for_property)
+ << 0 /* getter */ << RefExpr->getPropertyDecl()->getName();
return ExprError();
}
@@ -1408,7 +1408,8 @@ ExprResult MSPropertyOpBuilder::buildGet
RefExpr->isArrow() ? tok::arrow : tok::period, SS, SourceLocation(),
GetterName, 0, true);
if (GetterExpr.isInvalid()) {
- S.Diag(RefExpr->getMemberLoc(), diag::error_cannot_find_suitable_getter)
+ S.Diag(RefExpr->getMemberLoc(),
+ diag::error_cannot_find_suitable_getter_setter) << 0 /* getter */
<< RefExpr->getPropertyDecl()->getName();
return ExprError();
}
@@ -1422,8 +1423,8 @@ ExprResult MSPropertyOpBuilder::buildGet
ExprResult MSPropertyOpBuilder::buildSet(Expr *op, SourceLocation sl,
bool captureSetValueAsResult) {
if (!RefExpr->getPropertyDecl()->hasSetter()) {
- S.Diag(RefExpr->getMemberLoc(), diag::err_no_setter_for_property)
- << RefExpr->getPropertyDecl()->getName();
+ S.Diag(RefExpr->getMemberLoc(), diag::err_no_getter_setter_for_property)
+ << 1 /* setter */ << RefExpr->getPropertyDecl()->getName();
return ExprError();
}
@@ -1437,7 +1438,8 @@ ExprResult MSPropertyOpBuilder::buildSet
RefExpr->isArrow() ? tok::arrow : tok::period, SS, SourceLocation(),
SetterName, 0, true);
if (SetterExpr.isInvalid()) {
- S.Diag(RefExpr->getMemberLoc(), diag::error_cannot_find_suitable_setter)
+ S.Diag(RefExpr->getMemberLoc(),
+ diag::error_cannot_find_suitable_getter_setter) << 1 /* setter */
<< RefExpr->getPropertyDecl()->getName();
return ExprError();
}
More information about the cfe-commits
mailing list