[clang] [clang-tools-extra] [clang][AST] Visit lambda bodies whose call operator is not a definition (PR #237067)
Zeyi Xu via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 30 06:53:49 PDT 2026
================
@@ -0,0 +1,45 @@
+// The check walks the body of a lambda that is part of a variable template
+// specialization instantiated in a module. Building the parent map must not
+// skip that body: the lambda body is reached through the call operator of the
+// closure type, and when the closure type is merged with one from another
+// module, the call operator the closure class refers to can be a declaration
+// without a body, with the definition living on another declaration of the
+// same entity.
+//
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+// RUN: %clang -std=c++20 -x c++-module -I%t -fmodule-output=%t/mod_a.pcm -c %t/mod_a.cppm -o %t/mod_a.o
----------------
zeyi2 wrote:
Could we use `--precompile` here instead? The generated object files are unused.
https://github.com/llvm/llvm-project/pull/237067
More information about the cfe-commits
mailing list