https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124388
Bug ID: 124388
Summary: meta::display_string_of(unnamed-union-member) gives
wrong description
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ivan.lazaric.gcc at gmail dot com
Target Milestone: ---
```
#include <meta>
struct S {
union {
int a;
char b;
};
};
consteval {
auto members = nonstatic_data_members_of(^^S,
std::meta::access_context::unchecked());
__builtin_constexpr_diag(0, "", display_string_of(members[0]));
}
```
Flags: "-std=c++26 -freflection"
Compiler output:
```
<source>:12:29: note: constexpr message: S::<unnamed bit-field>
```
The single nonstatic data member is not a bit field.
Godbolt of example: https://godbolt.org/z/fbbbzqePW