[clang] [Clang][P1061] Fix template arguments in local classes (PR #121225)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 27 20:49:24 PST 2024
================
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only %s -verify
+// expected-no-diagnostics
+
+template <int i>
+int g() {
+ return [] (auto) -> int {
+ struct L {
+ int m = i;
+ };
+ return 0;
+ } (42);
----------------
zyn0217 wrote:
I feel like this is some fallout of not decoupling instantiating lambda body from the lambda transformation. If we had been able to avoid the body transform when transforming the lambda for the call expression, we could also have avoided instantiating an offending intermediate `L`, right? @erichkeane
https://github.com/llvm/llvm-project/pull/121225
More information about the cfe-commits
mailing list