Am Dienstag, dem 21.01.2025 um 21:13 +0000 schrieb Joseph Myers: > On Tue, 21 Jan 2025, Martin Uecker wrote: > > > The bigger issue seems that if you forward reference a member, you > > do not yet know its type. So whatever syntax we pick, general expressions > > seem problematic anyway: > > > > struct { > > char *buf [[counted_by(2 * .n + 3)]]; > > unsigned int n; > > That's why N3188 would require such a not-yet-declared member to have type > const size_t.
Indeed, but this might not be viable if the goal is to annotate existing code using counted_by where the type might be something else and can not be changed. (And in my programs I am using "int" for my array lengths because this allows me to find overflows, which I then couldn't anymore.) Martin >