]> gcc.gnu.org Git - gcc.git/commitdiff
testsuite: Add testcase for already fixed PR [PR102489]
authorJakub Jelinek <jakub@redhat.com>
Tue, 22 Mar 2022 14:37:20 +0000 (15:37 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 22 Mar 2022 14:37:20 +0000 (15:37 +0100)
This got broken with r12-3529 and fixed with r12-5255.

2022-03-22  Jakub Jelinek  <jakub@redhat.com>

PR c++/102489
* g++.dg/coroutines/pr102489.C: New test.

gcc/testsuite/g++.dg/coroutines/pr102489.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/coroutines/pr102489.C b/gcc/testsuite/g++.dg/coroutines/pr102489.C
new file mode 100644 (file)
index 0000000..0ef06da
--- /dev/null
@@ -0,0 +1,16 @@
+// PR c++/102489
+// { dg-do compile }
+// { dg-additional-options "-O" }
+
+#include <coroutine>
+
+struct footask {
+  struct promise_type {
+    std::suspend_never initial_suspend();
+    std::suspend_never final_suspend() noexcept;
+    void unhandled_exception();
+    void get_return_object();
+  };
+  std::suspend_always foo;
+  footask taskfun() { co_await foo; }
+};
This page took 0.06741 seconds and 5 git commands to generate.