Skip to content

_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS causes bad diagnostics #63900

Closed
@smeenai

Description

@smeenai

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.

Metadata

Metadata

Assignees

Labels

libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions