[clang] [Clang] Don't assert on substituted-but-yet-expanded packs for nested lambdas (PR #112896)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 20 19:50:41 PDT 2024


================
@@ -94,3 +94,45 @@ template <typename... Ts> void g2(Ts... p1s) {
 void f1() { g(); }
 
 } // namespace GH61460
+
+namespace GH112352 {
+
+template <class>
+constexpr bool foo = false;
+
+template <int>
+constexpr bool bar = false;
+
+template <template<class> class>
+constexpr bool baz = false;
+
+struct S {
+  template <typename... Types, int... Values> void foldExpr1() {
+    (void)[]<int... Is> {
+      ([] {
+        Is;
+        // Propagate up the flag ContainsUnexpandedParameterPack from VarDecl.
+        S var(foo<Types>);
+        foo<Types>;
+        bar<Values>;
+      } &&
+       ...);
+    };
+  }
+
+  template <template<class> class... TTPs> void foldExpr2() {
+    (void)[]<int... Is> {
+      ([] {
+        Is;
+        baz<TTPs>;
----------------
zyn0217 wrote:

Both work. Added to the test though

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


More information about the cfe-commits mailing list