Skip to content

Calling coroutines should be disallowed from [[nonallocating]] performance constraint setting #111050

Open
@cjappl

Description

@cjappl

C++20 coroutines allocate when beginning execution (source: Coroutines (C++20) - cppreference.com)

the coroutine state, which is internal, dynamically-allocated storage (unless the allocation is optimized out) …


When a coroutine begins execution, it performs the following:

allocates the coroutine state object using operator new.

The new performance constraints attributes ([[clang::nonallocating]] and stricter) should detect and warn about coroutines being called from a nonallocating context.

CC @dougsonos (I can't assign you because you aren't a member, but consider yourself "assigned")

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions