public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/112341] New: error: insufficient contextual information to determine type on co_await result in function template
@ 2023-11-01 20:46 ed at catmur dot uk
  2023-11-01 20:51 ` [Bug c++/112341] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: ed at catmur dot uk @ 2023-11-01 20:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112341
           Summary: error: insufficient contextual information to
                    determine type on co_await result in function template
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ed at catmur dot uk
  Target Milestone: ---

#include <coroutine>
struct A { int j; };
struct B {
    bool await_ready();
    bool await_suspend(std::coroutine_handle<>);
    A await_resume();
};
struct C {
    struct promise_type {
        std::suspend_always initial_suspend();
        std::suspend_always final_suspend() noexcept;
        void unhandled_exception();
        C get_return_object();
        void return_void();
    };
};
C f(auto) { (co_await B()).j; }
void g() { f(0); }

<source>: In function 'C f(auto:1)':
<source>:17:14: error: insufficient contextual information to determine type
   17 | C f(auto) { (co_await B()).j; }
      |             ~^~~~~~~~~~~~~

Writing 'auto&& a = co_await B(); a.j;' or even 'auto(co_await B()).j' accepts.

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

* [Bug c++/112341] error: insufficient contextual information to determine type on co_await result in function template
  2023-11-01 20:46 [Bug c++/112341] New: error: insufficient contextual information to determine type on co_await result in function template ed at catmur dot uk
@ 2023-11-01 20:51 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-01 20:51 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-11-01
     Ever confirmed|0                           |1
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

end of thread, other threads:[~2023-11-01 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-01 20:46 [Bug c++/112341] New: error: insufficient contextual information to determine type on co_await result in function template ed at catmur dot uk
2023-11-01 20:51 ` [Bug c++/112341] " pinskia 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).