]> granicus.if.org Git - clang/commit
Add a warning for implicit conversion from function literals (and static
authorLang Hames <lhames@gmail.com>
Mon, 5 Dec 2011 20:49:50 +0000 (20:49 +0000)
committerLang Hames <lhames@gmail.com>
Mon, 5 Dec 2011 20:49:50 +0000 (20:49 +0000)
commite14ca9f509dc22d8fcc5d21d70d28a5848983b42
treefb770f80bd76355fe1f461f1761962e21add4ae4
parent0dd7a25e8d679de1dc0ce788222d6dee0e879885
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145849 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaChecking.cpp
test/CXX/over/over.over/p2-resolve-single-template-id.cpp
test/SemaCXX/condition.cpp
test/SemaTemplate/resolve-single-template-id.cpp