From ce8220bf4f0c676dcf16b2dbb9aadff5e0986c21 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 19 Dec 2014 14:56:49 +0000 Subject: [PATCH] Putting unevaluated expression warnings, and evaluated typeid warnings, under their own warning flags. Amends r224465. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224578 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticGroups.td | 6 +++++- include/clang/Basic/DiagnosticSemaKinds.td | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index fec8ef12d4..aba17c5b97 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -409,7 +409,11 @@ def UnusedMemberFunction : DiagGroup<"unused-member-function", def UnusedLabel : DiagGroup<"unused-label">; def UnusedParameter : DiagGroup<"unused-parameter">; def UnusedResult : DiagGroup<"unused-result">; -def UnusedValue : DiagGroup<"unused-value", [UnusedComparison, UnusedResult]>; +def PotentiallyEvaluatedExpression : DiagGroup<"potentially-evaluated-expression">; +def UnevaluatedExpression : DiagGroup<"unevaluated-expression", + [PotentiallyEvaluatedExpression]>; +def UnusedValue : DiagGroup<"unused-value", [UnusedComparison, UnusedResult, + UnevaluatedExpression]>; def UnusedConstVariable : DiagGroup<"unused-const-variable">; def UnusedVariable : DiagGroup<"unused-variable", [UnusedConstVariable]>; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index dadf3756d8..f3af9df8d1 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -6110,10 +6110,10 @@ def warn_unused_call : Warning< InGroup; def warn_side_effects_unevaluated_context : Warning< "expression with side effects has no effect in an unevaluated context">, - InGroup; + InGroup; def warn_side_effects_typeid : Warning< "expression with side effects will be evaluated despite being used as an " - "operand to 'typeid'">, InGroup; + "operand to 'typeid'">, InGroup; def warn_unused_result : Warning< "ignoring return value of function declared with warn_unused_result " "attribute">, InGroup>; -- 2.40.0