Kaydet (Commit) 222c94f5 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 20d08026
......@@ -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(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment