Skip to content

Clang error: lambda-coroutine with operator new in promise_type  #84064

Closed
@andreasfertig

Description

@andreasfertig

Hello,

the following code is accepted by g++ and MSVC, but rejected by Clang:

https://compiler-explorer.com/z/hG58nq7TE (lambda)
https://compiler-explorer.com/z/7WM7eP3h7 (struct and coroutine member function)

Without the This parameter for operator new and passing another parameter, the code is accepted by Clang but rejected by g++ and MSVC:

https://compiler-explorer.com/z/dnEhsj6hP

With my reading of http://eel.is/c++draft/dcl.fct.def.coroutine#4 and http://eel.is/c++draft/dcl.fct.def.coroutine#9.1 Clang is wrong in both cases. It should accept the first and second example but reject the third.

Metadata

Metadata

Assignees

Labels

clang:frontendLanguage frontend issues, e.g. anything involving "Sema"coroutinesC++20 coroutines

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions