r188940 - Updated the consumed analysis warnings to use a more standardized diagnostic.
Aaron Ballman
aaron at aaronballman.com
Wed Aug 21 15:07:20 PDT 2013
Author: aaronballman
Date: Wed Aug 21 17:07:20 2013
New Revision: 188940
URL: http://llvm.org/viewvc/llvm-project?rev=188940&view=rev
Log:
Updated the consumed analysis warnings to use a more standardized diagnostic.
Patch thanks to Christian Wailes!
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=188940&r1=188939&r2=188940&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Aug 21 17:07:20 2013
@@ -2189,9 +2189,6 @@ def warn_use_while_consumed : Warning<
def warn_use_of_temp_while_consumed : Warning<
"invocation of method '%0' on a temporary object while it is in the "
"'consumed' state">, InGroup<Consumed>, DefaultIgnore;
-def warn_uniqueness_attribute_wrong_decl_type : Warning<
- "%0 attribute only applies to methods">,
- InGroup<Consumed>, DefaultIgnore;
// ConsumedStrict warnings
def warn_use_in_unknown_state : Warning<
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=188940&r1=188939&r2=188940&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed Aug 21 17:07:20 2013
@@ -974,8 +974,8 @@ static void handleConsumesAttr(Sema &S,
if (!checkAttributeNumArgs(S, Attr, 0)) return;
if (!(isa<CXXMethodDecl>(D) || isa<CXXConstructorDecl>(D))) {
- S.Diag(Attr.getLoc(), diag::warn_uniqueness_attribute_wrong_decl_type) <<
- Attr.getName();
+ S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
+ << Attr.getName() << ExpectedMethod;
return;
}
@@ -989,8 +989,8 @@ static void handleCallableWhenUnconsumed
if (!checkAttributeNumArgs(S, Attr, 0)) return;
if (!isa<CXXMethodDecl>(D)) {
- S.Diag(Attr.getLoc(), diag::warn_uniqueness_attribute_wrong_decl_type) <<
- Attr.getName();
+ S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
+ << Attr.getName() << ExpectedMethod;
return;
}
@@ -1004,8 +1004,8 @@ static void handleTestsConsumedAttr(Sema
if (!checkAttributeNumArgs(S, Attr, 0)) return;
if (!isa<CXXMethodDecl>(D)) {
- S.Diag(Attr.getLoc(), diag::warn_uniqueness_attribute_wrong_decl_type) <<
- Attr.getName();
+ S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
+ << Attr.getName() << ExpectedMethod;
return;
}
@@ -1019,8 +1019,8 @@ static void handleTestsUnconsumedAttr(Se
if (!checkAttributeNumArgs(S, Attr, 0)) return;
if (!isa<CXXMethodDecl>(D)) {
- S.Diag(Attr.getLoc(), diag::warn_uniqueness_attribute_wrong_decl_type) <<
- Attr.getName();
+ S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
+ << Attr.getName() << ExpectedMethod;
return;
}
More information about the cfe-commits
mailing list