<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/111050>111050</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Calling coroutines should be disallowed from [[nonallocating]] performance constraint setting
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
cjappl
</td>
</tr>
</table>
<pre>
C++20 coroutines allocate when beginning execution (source: [Coroutines (C++20) - cppreference.com](https://en.cppreference.com/w/cpp/language/coroutines))
>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](https://en.cppreference.com/w/cpp/language/coroutines#Dynamic_allocation) the coroutine state object using [operator new](https://en.cppreference.com/w/cpp/memory/new/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
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyslM2OozgQx5_GXEodgYEJHDjko3mClfY4MqYAj4yN7PJkep9-VfnoTPf2aTVSRISNy__fj8IqRjM7xE7UR1GfM5Vo8aHTP9S22Wzw41t3EvIo5FHmoH3wiYzDCMparxUhXBZ0MOBsnDNuBvyFOpHxDoRsok9BoygPIOrj6blYyOa9qJAtvIDetoATBnQad9qvoj4L2SxEWxTlQcheyB7d7j-Pyf4iZK-3TcjeKjcnNSMPvO8lZMu__Czyw_1avtKCTxaIpAiFPMFlMXoBE8E4wuCU5cHxzanVaGXt28sDeoRIPqgZmSQ5izEC17zPM72J4Dcyq_kHR_CJGFO8StHk4vDtU5zP4-Xr3yxV_ZbxKjg-7XIyQ7BhmHxYb7tP3lp_MW5mY592qI-P7PEPqi3PNznfn-DM-YVe8MMP1AQpcpOI-ug3DIp8AIeX_5NoxdWHNyF7Xi_7R7nv19t294H_ev1rQd7roUw5zSFdpKCMowiKKJgh0a09r1_DUTM3RyoPzrsHpJs5cH0G5bgRgtGEgbnj4pMdYURiVJ69qOBADT7R79_OgCyBWwpHmIJfQcGH-hyM8Bd9wDidQFT56NMcvfMRsrErx7ZsVYZdsZf7tqm-1XW2dE2R79uhHeTQTnml9dQgjrkqdCFVsx9UZjqZy6rI87Joq6qod2rC_R6nEcdiUlVZiyrHVRm7s_bnuvNhzkyMCbuiKPI6z6wa0MbriSElO73OCin5AAkdL3oZ0hxFlVsTKT7LkCGL3UlZe6N8V3JXNyCMJrKIy0PN7U18pf_rNwkRiR_KUrDdx56aDS1puLcSZ7r_vWzBc3cK2V9JopD9HfVnJ_8NAAD__1XSsbI">