[clang] [C++20] [Modules] Don't profiling the callee of CXXFoldExpr (PR #190732)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 7 00:01:53 PDT 2026


================
@@ -2390,7 +2390,35 @@ void StmtProfiler::VisitMaterializeTemporaryExpr(
 }
 
 void StmtProfiler::VisitCXXFoldExpr(const CXXFoldExpr *S) {
-  VisitExpr(S);
+  // For CXXFoldExpr, not profile the call expression as it may
+  // be affected by the context. e.g.,
----------------
ChuanqiXu9 wrote:

It's the call to possible "operator &&()". You can look at the test for example. I met the problem before, roughly 2~3 years ago. But I thought this is  problem of user codes that time.

But now I realized it was super weird to override the behavior of '&&' or '||' in fold expression. So I decide to send this.

https://github.com/llvm/llvm-project/pull/190732


More information about the cfe-commits mailing list