PiotrZSL added a comment.

In D156624#4545170 <https://reviews.llvm.org/D156624#4545170>, @sousajo wrote:

> Good point, I cannot think of an _easy_ way to check it.

I think you can do something like this:

  Finder->addMatcher(
      cxxOperatorCallExpr(
          hasOverloadedOperatorName("[]"),
          
calle(cxxMethodDecl(ofClass(cxxRecordDecl(hasName("::std::array")).bind("type"))))
          hasArgument(1, expr().bind("index")))
          .bind("expr"),
      this);

In such case instead of checking argument passed to call, we check what 
operator we used and who provided it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156624

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to