public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101144] New: Coroutine compiler error
@ 2021-06-21  8:13 victor.burckel at gmail dot com
  2021-08-30 14:29 ` [Bug c++/101144] " liuyaoxin1976 at qq dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: victor.burckel at gmail dot com @ 2021-06-21  8:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101144

            Bug ID: 101144
           Summary: Coroutine compiler error
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: victor.burckel at gmail dot com
  Target Milestone: ---

Hello,

When trying to await the following coroutine, I get a compiler internal error
> internal compiler error: in build_special_member_call, at cp/call.c:10157

See it on godbolt: https://godbolt.org/z/f178vEqc9

#include <coroutine>
#include <vector>
#include <string>

struct task {
  struct promise_type {
    auto initial_suspend() noexcept { return std::suspend_always{}; }
    auto final_suspend() noexcept { return std::suspend_always{}; }
    void return_void() {}
    task get_return_object() { return task{}; }
    void unhandled_exception() noexcept {}
  };

  ~task() noexcept {}

  bool await_ready() const noexcept { return false; }
  void await_suspend(std::coroutine_handle<>) noexcept {}
  void await_resume() noexcept {}
};

task f(const std::vector<std::string>&)
{
    co_return;
}

task g()
{
    co_await f({"2", "3"});
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/101144] Coroutine compiler error
  2021-06-21  8:13 [Bug c++/101144] New: Coroutine compiler error victor.burckel at gmail dot com
@ 2021-08-30 14:29 ` liuyaoxin1976 at qq dot com
  2021-08-31 10:37 ` redi at gcc dot gnu.org
  2021-09-30 20:18 ` iains at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: liuyaoxin1976 at qq dot com @ 2021-08-30 14:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101144

Yaoxin Liu <liuyaoxin1976 at qq dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |liuyaoxin1976 at qq dot com

--- Comment #1 from Yaoxin Liu <liuyaoxin1976 at qq dot com> ---
#include <coroutine>
#include <string>
#include <vector>

using namespace std::literals;

struct task {
  struct promise_type {
    auto initial_suspend() noexcept { return std::suspend_always{}; }
    auto final_suspend() noexcept { return std::suspend_always{}; }
    void return_void() {}
    task get_return_object() { return task{}; }
    void unhandled_exception() noexcept {}
  };

  bool await_ready() const noexcept { return false; }
  void await_suspend(std::coroutine_handle<>) noexcept {}
  void await_resume() noexcept {}
};

task f(std::vector<int>) { co_return; }

task f(std::vector<std::string>) { co_return; }

task g() {
  co_await f(std::vector<int>{1, 2, 3});  // ok
  co_await f(std::vector<std::string>{}); // ok

  auto s1 = "hello1"s;
  auto s2 = "hello2"s;
  auto s3 = "hello3"s;
  co_await f(std::vector<std::string>{s1, s2, s3}); // error
}

See https://godbolt.org/z/z9x8Y96j6

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/101144] Coroutine compiler error
  2021-06-21  8:13 [Bug c++/101144] New: Coroutine compiler error victor.burckel at gmail dot com
  2021-08-30 14:29 ` [Bug c++/101144] " liuyaoxin1976 at qq dot com
@ 2021-08-31 10:37 ` redi at gcc dot gnu.org
  2021-09-30 20:18 ` iains at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2021-08-31 10:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101144

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-08-31
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/101144] Coroutine compiler error
  2021-06-21  8:13 [Bug c++/101144] New: Coroutine compiler error victor.burckel at gmail dot com
  2021-08-30 14:29 ` [Bug c++/101144] " liuyaoxin1976 at qq dot com
  2021-08-31 10:37 ` redi at gcc dot gnu.org
@ 2021-09-30 20:18 ` iains at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: iains at gcc dot gnu.org @ 2021-09-30 20:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101144

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iains at gcc dot gnu.org
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
duplicate of 98056

*** This bug has been marked as a duplicate of bug 98056 ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-30 20:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21  8:13 [Bug c++/101144] New: Coroutine compiler error victor.burckel at gmail dot com
2021-08-30 14:29 ` [Bug c++/101144] " liuyaoxin1976 at qq dot com
2021-08-31 10:37 ` redi at gcc dot gnu.org
2021-09-30 20:18 ` iains at gcc dot gnu.org

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).