summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/condition.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2011-12-06 04:48:01 +0000
committerRichard Trieu <rtrieu@google.com>2011-12-06 04:48:01 +0000
commit5f623229ecb37218f463f43def51e4b0807d6077 (patch)
treea91d5a2b2ac309fb311035b1f58db321593068ac /clang/test/SemaCXX/condition.cpp
parent5e2192adb592492d7b42f1a2831bed7a8585e604 (diff)
downloadbcm5719-llvm-5f623229ecb37218f463f43def51e4b0807d6077.tar.gz
bcm5719-llvm-5f623229ecb37218f463f43def51e4b0807d6077.zip
Switch a cast to a dyn_cast and check the pointer before using. Fixes a crash
in the following code: void test4(bool (&x)(void)) { while (x); } llvm-svn: 145918
Diffstat (limited to 'clang/test/SemaCXX/condition.cpp')
-rw-r--r--clang/test/SemaCXX/condition.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/condition.cpp b/clang/test/SemaCXX/condition.cpp
index 21671fab3c0..7854d51bfd7 100644
--- a/clang/test/SemaCXX/condition.cpp
+++ b/clang/test/SemaCXX/condition.cpp
@@ -52,3 +52,7 @@ void test3() {
if (test3) // expected-warning {{address of function 'test3' will always evaluate to 'true'}}
(void) 0;
}
+
+void test4(bool (&x)(void)) {
+ while (x);
+}
OpenPOWER on IntegriCloud