If using SSH remote, specify OS of remote machine: Debian 11/bullseye
Bug Summary and Steps to Reproduce
Bug Summary:
The C/C++ extension shows an error for coroutines implemented as non-static member functions when using the std::coroutine_traits to define the promise type. Consider the following minimal example:
In this case, we define the promise_type of the Resumable struct using std::coroutine_traits. The documentation states that for coroutines defined as non-static member functions. ARGS must include the implicit object parameter, hence, struct coroutine_traits includes Outer & in the template parameter list.
The extension, however, shows the following error for the coroutine Outer::coroutine(), expecting the second parameter to be of type Outer * instead of the correct Outer &:
class "std::__n4861::coroutine_traits<Resumable, Outer *>" has no member "promise_type "C/C++(135)
Steps to reproduce:
Open a file with the above contents in VS Code and the C/C++ extension installed as minimal.cpp.
See error for Outer::coroutine()
Expected behavior:
The lookup for promise_type is done via std::__n4861::coroutine_traits<Resumable, Outer &>::promise_type instead of std::__n4861::coroutine_traits<Resumable, Outer *>.
Environment
Bug Summary and Steps to Reproduce
Bug Summary: The C/C++ extension shows an error for coroutines implemented as non-static member functions when using the std::coroutine_traits to define the promise type. Consider the following minimal example:
The example can be compiled with the command line
In this case, we define the
promise_type
of theResumable
struct usingstd::coroutine_traits
. The documentation states that for coroutines defined as non-static member functions. ARGS must include the implicit object parameter, hence,struct coroutine_traits
includesOuter &
in the template parameter list.The extension, however, shows the following error for the coroutine Outer::coroutine(), expecting the second parameter to be of type
Outer *
instead of the correctOuter &
:Steps to reproduce:
minimal.cpp
.Expected behavior: The lookup for
promise_type
is done viastd::__n4861::coroutine_traits<Resumable, Outer &>::promise_type
instead ofstd::__n4861::coroutine_traits<Resumable, Outer *>
.Configuration and Logs
Contents of
c_cpp_properties.json
:Log Diagnostics:
Language server log:
Other Extensions
Additional context
No response