[PATCH] D45601: Warn on bool* to bool conversion
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 17 10:37:49 PDT 2018
efriedma added inline comments.
================
Comment at: lib/Sema/SemaChecking.cpp:2623
+ QualType QT = Pointer->getType()->getPointeeType();
+ if (!QT.isNull() && QT->isBooleanType())
+ // Warn on bool* to bool conversion.
----------------
Have you considered skipping the isBooleanType() check? Passing any pointer to a function which expects a boolean parameter seems fundamentally suspicious.
https://reviews.llvm.org/D45601
More information about the cfe-commits
mailing list