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

            Bug ID: 95516
           Summary: [coroutines] incorrect warning "'coro.gro' is used
                    uninitialized"
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bruck.michael at gmail dot com
  Target Milestone: ---

#include <coroutine>

struct dummy
{
    struct promise_type
    {
        dummy get_return_object() const noexcept { return {}; }
        std::suspend_never initial_suspend() const noexcept { return {}; }
        std::suspend_never final_suspend() const noexcept { return {}; }
        void return_void() const noexcept {}
        void unhandled_exception() const noexcept {}
    };
    // int i; // this kills the warning
};

dummy foo()
{ 
    co_return;
}

int main()
{
    foo();
}
---

<source>: In function 'dummy foo()':
<source>:19:1: warning: 'coro.gro' is used uninitialized in this function
[-Wuninitialized]
   19 | }
      | ^

Reply via email to