diff options
author | Richard Trieu <rtrieu@google.com> | 2011-12-06 04:48:01 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2011-12-06 04:48:01 +0000 |
commit | 5f623229ecb37218f463f43def51e4b0807d6077 (patch) | |
tree | a91d5a2b2ac309fb311035b1f58db321593068ac /clang/test/SemaCXX/condition.cpp | |
parent | 5e2192adb592492d7b42f1a2831bed7a8585e604 (diff) | |
download | bcm5719-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.cpp | 4 |
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); +} |