summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-unsequenced.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-01-17 23:46:04 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-01-17 23:46:04 +0000
commit5011a0022a4d693870fd3198f464451dec0bc653 (patch)
tree6d9c8f60a6df09eb5dea9282573a8224b4e55106 /clang/test/SemaCXX/warn-unsequenced.cpp
parentcd78037ad117b12b549d7e7d1d1435f9803e678e (diff)
downloadbcm5719-llvm-5011a0022a4d693870fd3198f464451dec0bc653.tar.gz
bcm5719-llvm-5011a0022a4d693870fd3198f464451dec0bc653.zip
Some builtins do not evaluate their arguments. Teach EvaluatedExprVisitor not
to visit them. llvm-svn: 172769
Diffstat (limited to 'clang/test/SemaCXX/warn-unsequenced.cpp')
-rw-r--r--clang/test/SemaCXX/warn-unsequenced.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn-unsequenced.cpp b/clang/test/SemaCXX/warn-unsequenced.cpp
index 15ca1dba7a8..c7acfca6db3 100644
--- a/clang/test/SemaCXX/warn-unsequenced.cpp
+++ b/clang/test/SemaCXX/warn-unsequenced.cpp
@@ -95,4 +95,9 @@ void test() {
xs[8] && (++a + a++); // expected-warning {{multiple unsequenced modifications}}
xs[8] || (++a + a++); // expected-warning {{multiple unsequenced modifications}}
+
+ (__builtin_classify_type(++a) ? 1 : 0) + ++a; // ok
+ (__builtin_constant_p(++a) ? 1 : 0) + ++a; // ok
+ (__builtin_object_size(&(++a, a), 0) ? 1 : 0) + ++a; // ok
+ (__builtin_expect(++a, 0) ? 1 : 0) + ++a; // expected-warning {{multiple unsequenced modifications}}
}
OpenPOWER on IntegriCloud