summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/vararg-non-pod.cpp
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
commit6c93b3e29c56d14eab570ce62cd646a95f0c1403 (patch)
tree69fbc580587cf8545f536f5fda9b6663791920a5 /clang/test/SemaCXX/vararg-non-pod.cpp
parent4de56ef736fedb64d059fa6a922abd10b5f18690 (diff)
downloadbcm5719-llvm-6c93b3e29c56d14eab570ce62cd646a95f0c1403.tar.gz
bcm5719-llvm-6c93b3e29c56d14eab570ce62cd646a95f0c1403.zip
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.
llvm-svn: 224465
Diffstat (limited to 'clang/test/SemaCXX/vararg-non-pod.cpp')
-rw-r--r--clang/test/SemaCXX/vararg-non-pod.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/vararg-non-pod.cpp b/clang/test/SemaCXX/vararg-non-pod.cpp
index 66da9964b42..39d4cccacd3 100644
--- a/clang/test/SemaCXX/vararg-non-pod.cpp
+++ b/clang/test/SemaCXX/vararg-non-pod.cpp
@@ -103,7 +103,7 @@ Base &get_base(...);
int eat_base(...);
void test_typeid(Base &base) {
- (void)typeid(get_base(base)); // expected-warning{{cannot pass object of non-POD type 'Base' through variadic function; call will abort at runtime}}
+ (void)typeid(get_base(base)); // expected-warning{{cannot pass object of non-POD type 'Base' through variadic function; call will abort at runtime}} expected-warning{{expression with side effects will be evaluated despite being used as an operand to 'typeid'}}
(void)typeid(eat_base(base)); // okay
}
OpenPOWER on IntegriCloud