================
@@ -51,7 +51,13 @@ static std::string 
getFullPrefix(ArrayRef<UseRangesCheck::Indexes> Signature) {
 namespace {
 
 AST_MATCHER(Expr, hasSideEffects) {
-  return Node.HasSideEffects(Finder->getASTContext());
+  bool CheckArg = true;
+  if (const CXXMemberCallExpr *Call = dyn_cast<CXXMemberCallExpr>(&Node)) {
+    if (Call->isLValue() && Call->getMethodDecl()->isConst()) {
+      CheckArg = false;
+    }
+  }
----------------
HerrCai0907 wrote:

According to comment in `HasSideEffects`.
>   IncludePossibleEffects is false, this call treats certain expressions with 
> potential side effects (such as function call-like expressions, 
> instantiation-dependent expressions, or invocations from a macro) as not 
> having side effects.

I think there are no relationship between `Call->isLValue() && 
Call->getMethodDecl()->isConst()` and `IncludePossibleEffects`.

https://github.com/llvm/llvm-project/pull/127377
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to