[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 18 05:55:11 PDT 2019


aaron.ballman added a comment.

The review says you abandoned it -- was that accidental?



================
Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:72
+
+    const Expr *Obj = BinOp->getLHS();
+    const std::string ObjName =
----------------
boga95 wrote:
> I found an interesting behavior with source location:
> 
> ```
> const SourceManager *Source = Result.SourceManager;
> 
> const char *StartPos = Source->getCharacterData(Obj->getLocStart());
> const char *EndPos = Source->getCharacterData(Obj->getLocEnd());
> ```
> `StartPos` and `EndPos` point to the exact same location. Is this the expected behavior or it is a bug?
That is expected behavior -- the source location points to the insertion point of the token and if there's only one token in the source range, two two locations will point to the same place.


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

https://reviews.llvm.org/D52281





More information about the cfe-commits mailing list