Bo Persson has now deleted the answer, that's right. The paragraph ([temp.class] / p4) that you quote refers to ยง7.1.6.3 [dcl.type.elab] for the definition of "agree in kind", which in turn says (p3, emphasis mine)
The keyword of the class or enum present in the specified type specifier must be consistent in kind with the declaration to which the name in the specifier of the specified type refers. This rule also applies to the form of a specified type specifier, which declares a class-name or a class of a friend, since it can be construed as referring to the class definition. Thus, in any specifier of the specified type, the enum keyword should be used to indicate enumeration (7.2), the union class key should be used to refer to the union (section 9), and either the class class or struct class-key should be used to indicate the class ( Section 9) declared using class or struct class-key .
The code is valid if it is incompatible.
source share