summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/condition.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2011-12-05 20:49:50 +0000
committerLang Hames <lhames@gmail.com>2011-12-05 20:49:50 +0000
commitdf5c121f8ed83da0df666734860762241ee450ca (patch)
tree17d4b75aea26f96167b8fac54fcb451a1ff8e1fa /clang/test/SemaCXX/condition.cpp
parentab7940f6e1ae76a6eb8adf64babf3563c9550830 (diff)
downloadbcm5719-llvm-df5c121f8ed83da0df666734860762241ee450ca.tar.gz
bcm5719-llvm-df5c121f8ed83da0df666734860762241ee450ca.zip
Add a warning for implicit conversion from function literals (and static
methods) to bool. E.g. void foo() {} if (f) { ... // <- Warns here. } Only applies to non-weak functions, and does not apply if the function address is taken explicitly with the addr-of operator. llvm-svn: 145849
Diffstat (limited to 'clang/test/SemaCXX/condition.cpp')
-rw-r--r--clang/test/SemaCXX/condition.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/condition.cpp b/clang/test/SemaCXX/condition.cpp
index 3441bae6707..21671fab3c0 100644
--- a/clang/test/SemaCXX/condition.cpp
+++ b/clang/test/SemaCXX/condition.cpp
@@ -49,6 +49,6 @@ void test3() {
if ("help")
(void) 0;
- if (test3)
+ if (test3) // expected-warning {{address of function 'test3' will always evaluate to 'true'}}
(void) 0;
}
OpenPOWER on IntegriCloud