Adapt loplugin:derefnullptr to old Clang versions
...where prior to r183883 "Implement core issue 903: only integer literals with value 0 and prvalues of type std::nullptr_t are null pointer constants from C++11 onwards," Expr::isNullPointerConstant with NPC_NeverValueDependent could go into an llvm_unreachable case. Change-Id: I29cf093f18ece4cd83fd759e30f72c2a71f69554
This commit is contained in:
@@ -26,7 +26,7 @@ public:
|
||||
bool DerefNullPtr::VisitUnaryDeref(UnaryOperator const * op) {
|
||||
if (!ignoreLocation(op)
|
||||
&& (op->getSubExpr()->IgnoreParenCasts()->isNullPointerConstant(
|
||||
compiler.getASTContext(), Expr::NPC_NeverValueDependent/*TODO*/)
|
||||
compiler.getASTContext(), Expr::NPC_ValueDependentIsNotNull/*TODO*/)
|
||||
!= Expr::NPCK_NotNull))
|
||||
{
|
||||
report(
|
||||
|
Reference in New Issue
Block a user