Date
2015-02-03.00:00:00
Message id
5507

Content

The example in 11.5 [class.union] paragraph 8 reads,

  union U {
    int x = 0;
    union { };
    union {
      int z;
      int y = 1; // error: initialization for second variant member of U
    };
  };

The empty anonymous union appears to be a violation of the requirement in 11.4 [class.mem] paragraph 1,

Except when used to declare friends (11.8.4 [class.friend]), to declare an unnamed bit-field (11.4.10 [class.bit]), or to introduce the name of a member of a base class into a derived class (9.10 [namespace.udecl]), or when the declaration is an empty-declaration, member-declarations declare members of the class, and each such member-declaration shall declare at least one member name of the class.