summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/DiagnosticSemaKinds.td
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-12-17 21:57:17 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-12-17 21:57:17 +0000
commitf1a2b5319ff6e4fb093c1dd3646e13c1086255a9 (patch)
tree3423aa4a85e5b0e647d7a7e7f6686a3c400fcd45 /include/clang/Basic/DiagnosticSemaKinds.td
parent9f988c44c935f42d9a131726302a7f997f2b3b37 (diff)
Adding a -Wunused-value warning for expressions with side effects used in an unevaluated expression context, such as sizeof(), or decltype(). Also adds a similar warning when the expression passed to typeid() *is* evaluated, since it is equally likely that the user would expect the expression operand to be unevaluated in that case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224465 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/DiagnosticSemaKinds.td')
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index a939f51d72..99049c8ebd 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -6107,6 +6107,12 @@ def warn_unused_container_subscript_expr : Warning<
def warn_unused_call : Warning<
"ignoring return value of function declared with %0 attribute">,
InGroup<UnusedValue>;
+def warn_side_effects_unevaluated_context : Warning<
+ "expression with side effects has no effect in an unevaluated context">,
+ InGroup<UnusedValue>;
+def warn_side_effects_typeid : Warning<
+ "expression with side effects will be evaluated despite being used as an "
+ "operand to 'typeid'">, InGroup<UnusedValue>;
def warn_unused_result : Warning<
"ignoring return value of function declared with warn_unused_result "
"attribute">, InGroup<DiagGroup<"unused-result">>;