https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60799

--- Comment #5 from Casey Carter <Casey at Carter dot net> ---
(In reply to TC from comment #4)
> 
> I don't think that reading makes much sense. Among member-declarations that
> do not declare a member are static_assert-declarations and unnamed bit-field
> declarations, so that reading disallows
> 
> class A {
>     constexpr static bool value = true;
>     friend class B;
> };
> 
> class B {
>     static_assert(B::value, "");
> };
> 
> And disallows D in the below example but not E:
> 
> class C {
>     constexpr static int value = 4;
>     friend class D;
>     friend class E;
> };
> 
> class D {
>     int : C::value;
> };
> 
> class E {
>     int i : C::value;
> };

I agree that my interpretation breaks things that should work, but given how
[class.mem]/1 goes out of its way to distinguish between member-declarations
and "declarations of members", it does seem to be what is specified. I think
the intent has been lost in the wording.

I've just discovered this problem is the topic of open CWG issue 1699
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1699; upstream is
already on-the-job.

Reply via email to