<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63900>63900</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS causes bad diagnostics
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc++
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
smeenai
</td>
</tr>
</table>
<pre>
I'm upgrading Meta's Android codebase to C++20, and I'm building with `-D_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS` globally to ease the initial transition. That somehow causes incomplete backtraces in some diagnostics. See https://godbolt.org/z/TMKWrzd59 as an example, where the error message has no reference to the actual problematic `emplace_back` call, whereas either building with `-std=c++17` (https://godbolt.org/z/1oq4q4Pb8) or removing `-D_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS` (https://godbolt.org/z/6v3f7aKor) gives the expected full error.
Can we improve this? I expect it's not uncommon to use `-D_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS` and other definitions during the C++20 upgrade process, and there are certain errors that are exposed only when building with C++20 (e.g. https://godbolt.org/z/cEMvdrca8), so this issue makes it much harder to figure out the cause of those errors.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVE1v2zgT_jX0ZRCBpizJPujgTyBo_CZIg3d7M0bkWOKWIlWScpL--gVlt10UC3S3FwkgOPPM88HBEHRriWpWbFixm-EYO-fr0BNZ1LPGqff6nomqh3FoPSptWzhSRCaqAGurvNMKpFPUYCCIDrZMbJjYCM7EFtAquFY3ozZT8auOHbCS3-1OD_eb7dPTaf-_9eZhf9p--iT46Xl_fPz_fndaPzw8btcvj8-n4_642T9_ZCWH1rgGjXlPODThdQTa6qjRQPRog47a2QxeOowQXE-dewWJY6AA2krXD4YiQYPyc_Qop9PpHiiNrXUhahky-EgEXYxDYPmaiQMTh9apxpmYOd8ycfjKxOHl-OEP_1UVK8AAaIHeMHVPrF878tfZyHvnoacQsCXoMIB14OlMnqyc5Eq3UMYRDQzeNYZ6jFomgagfDEo6pWETeYnGfO-OAUjHjvw_CBuiYvlOXn2YV6mWieWv-Mzdl8WXxVOzZGIFzoOn3l1S39_06l9Alpf8XOEH5xNkqy8UrqK9DSQjKTiPxlwlzBjfMb6-frdo4ZVA94N3l6SzDiw_wP2tEHScwmldhDF53jublB4D_S6XFGM3qa3oPOXN2QBq9EmfNPL30N9eCSUzJYXw7RHEKRLoCST5iNpeeSXCGKdzehtcIAXOmvfksf3J2R8QTCwpa7NfJlTujxflJSZH0xzBTVqBDmEk6PFzin-EfpQddOgV-STTWbejJ3BjnJhNjwfcGWLnwi3QIZupOlerfIUzquflclUU-UoUs64usVTzplzxHFW5LM88z5HzEsuioqqS1UzXgoucV_OK81zwIlvIQswFlbIUMm_UmS049ahNZsylT2xm07x1ma84nxlsyIRpWQlhdHNLORMiLS9fp6K7ZmwDW3CjQww_2kQdDdX_zfxvu6NB9fcNMRu9qX-SX8dubDLpeiYOCfP2uxu8-5NkZOIw8Qgp94nKXwEAAP__5EXHBA">