On Tue, Feb 03, 2026 at 11:22:48PM +0100, Jakub Jelinek wrote:
> On Tue, Feb 03, 2026 at 05:11:09PM -0500, Marek Polacek wrote:
> > Bootstrapped/regtested on ppc64le-pc-linux-gnu, ok for 17.0?
> >
> > -- >8 --
> > This implements [class.bit]/2: An unnamed bit-field shall not be
> > declared with a cv-qualified type. This was clarified in DR 2229.
> >
> > DR 2229
> > PR c++/123935
> >
> > gcc/cp/ChangeLog:
> >
> > * decl2.cc (grokbitfield): Disallow cv-qualified unnamed bit-fields.
> >
> > gcc/testsuite/ChangeLog:
> >
> > * g++.dg/DRs/dr2229.C: New test.
>
> Wonder what this means for
> https://eel.is/c++draft/meta.reflection#define.aggregate-5.4
> Shouldn't data_member_spec throw if options.bit_width contains a value and
> options.name doesn't contain a value and is_const (type) or is_volatile
> (type) is true?
> Do we want a LWG issue for that?
Good point. So throw for all three:
```
#include <meta>
constexpr auto d1 = std::meta::data_member_spec (^^const int, { .bit_width = 1
});
constexpr auto d2 = std::meta::data_member_spec (^^volatile int, { .bit_width =
1 });
constexpr auto d3 = std::meta::data_member_spec (^^const volatile int, {
.bit_width = 1 });
```
I can file an issue tomorrow.
Marek