diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-07-30 16:17:54 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-07-30 16:21:55 +0200 |
commit | 222c94f5a40a8bb4134b31ed6dbfb5e3913197a6 (patch) | |
tree | befa2686a4edfbc5a782e2860613c18ac613d857 /compilerplugins/clang | |
parent | 20d08026218cf4257693c706c97030b8d518aa68 (diff) |
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
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r-- | compilerplugins/clang/derefnullptr.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compilerplugins/clang/derefnullptr.cxx b/compilerplugins/clang/derefnullptr.cxx index 5663e4f27d46..83fa5c4a0b91 100644 --- a/compilerplugins/clang/derefnullptr.cxx +++ b/compilerplugins/clang/derefnullptr.cxx @@ -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( |