* g++.dg/cpp1z/fold-lambda3.C: Add test for 88183.
authorJason Merrill <jason@gcc.gnu.org>
Fri, 1 Mar 2019 00:10:28 +0000 (19:10 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 1 Mar 2019 00:10:28 +0000 (19:10 -0500)
From-SVN: r269294

gcc/testsuite/g++.dg/cpp1z/fold-lambda3.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp1z/fold-lambda3.C b/gcc/testsuite/g++.dg/cpp1z/fold-lambda3.C
new file mode 100644 (file)
index 0000000..5a53c86
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/88183
+// { dg-do compile { target c++17 } }
+
+struct A { int i; };
+
+template <class T> T& g(T);
+
+template <class U, class... Vs>
+void f(U u, Vs... vs)
+{ 
+  [vs...](auto x) {
+    (g(x) .* ... .* vs) = 42;
+  }(u);
+}
+
+int main()
+{
+  f(A(), &A::i);
+}