public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] c++: Add testcase for already fixed PR [PR90215]
@ 2021-04-09 15:48 Patrick Palka
  0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2021-04-09 15:48 UTC (permalink / raw)
  To: gcc-patches

We accept this testcase after r11-7985.

gcc/testsuite/ChangeLog:

	PR c++/90215
	* g++.dg/cpp1z/fold-lambda4.C: New test.
---
 gcc/testsuite/g++.dg/cpp1z/fold-lambda4.C | 30 +++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/cpp1z/fold-lambda4.C

diff --git a/gcc/testsuite/g++.dg/cpp1z/fold-lambda4.C b/gcc/testsuite/g++.dg/cpp1z/fold-lambda4.C
new file mode 100644
index 00000000000..b8bae8602ad
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/fold-lambda4.C
@@ -0,0 +1,30 @@
+// PR c++/90215
+// { dg-do compile { target c++17 } }
+
+struct X
+{
+    template <class F>
+    void f(F f)
+    {
+        f(0);
+    }
+};
+
+template <class... Xs>
+void bug(Xs... xs)
+{
+    int i;
+
+    [&](auto&... ys)
+    {
+        (xs.f([&](auto)
+        {
+            ys;
+        }), ...);
+    }(i);
+}
+
+int main()
+{
+    bug(X{});
+}
-- 
2.31.1.272.g89b43f80a5


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-09 15:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09 15:48 [committed] c++: Add testcase for already fixed PR [PR90215] Patrick Palka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).