[PATCH] D100723: [AST] Fix comparison to of SourceRanges in container

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 19 13:11:39 PDT 2021


njames93 accepted this revision.
njames93 added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/Tooling/NodeIntrospection.cpp:47
     std::pair<SourceRange, SharedLocationCall> const &RHS) const {
-  if (!LHS.first.isValid() || !RHS.first.isValid())
-    return false;
----------------
steveire wrote:
> njames93 wrote:
> > Maybe we should assert the ranges (or locations) are valid before inserting. Will require modification to the generator script but it would make subsequent handling simpler. 
> I don't think I agree, but I think that's a different patch. We should fix the bug for now.
Fair enough, though this doesn't seem a great solution, Semantics of Sourcelocation comparisons for invalid source lox


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100723/new/

https://reviews.llvm.org/D100723



More information about the cfe-commits mailing list