From df5c121f8ed83da0df666734860762241ee450ca Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Mon, 5 Dec 2011 20:49:50 +0000 Subject: 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 --- clang/test/SemaCXX/condition.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/test/SemaCXX/condition.cpp') 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; } -- cgit v1.2.3