diff options
author | Lang Hames <lhames@gmail.com> | 2011-12-05 20:49:50 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2011-12-05 20:49:50 +0000 |
commit | df5c121f8ed83da0df666734860762241ee450ca (patch) | |
tree | 17d4b75aea26f96167b8fac54fcb451a1ff8e1fa /clang/test/SemaCXX/condition.cpp | |
parent | ab7940f6e1ae76a6eb8adf64babf3563c9550830 (diff) | |
download | bcm5719-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.cpp | 2 |
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; } |