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
diff --git a/clang/test/SemaCXX/condition.cpp b/clang/test/SemaCXX/condition.cpp
index 21671fa..7854d51 100644
--- a/clang/test/SemaCXX/condition.cpp
+++ b/clang/test/SemaCXX/condition.cpp
@@ -52,3 +52,7 @@
if (test3) // expected-warning {{address of function 'test3' will always evaluate to 'true'}}
(void) 0;
}
+
+void test4(bool (&x)(void)) {
+ while (x);
+}