https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124312
Bug ID: 124312
Summary: [reflection] vector<meta::info> unusable in consteval
context with _GLIBCXX_DEBUG=1
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: giel+gcc at mortis dot eu
Target Milestone: ---
When trying to build a project that was using reflection to construct a concept
I discovered std::vector<std::meta::info> to be unusable in constant
expressions (consteval) when defining _GLIBCXX_DEBUG=1. I suspect the debug
implementation isn't yet ready to function properly for that.
https://godbolt.org/z/YGxaGvv31
```
#include <meta>
#include <type_traits>
struct A
{
int i;
};
enum class [[=A(42)]] E
{
X,
};
template <typename AnnEnum>
concept is_annotated_enum =
std::is_enum_v<AnnEnum>
&& annotations_of(^^AnnEnum).size() > 0;
static_assert(is_annotated_enum<E>);
```