Extends _Generic selection expressions to accept a type operand in addition to an expression operand. The type operand form does not perform lvalue conversions on the operand, which allows the expression to select *qualified* types, making it more useful for generic programming in C.
C has a few operators that take either a type or an expression, such as sizeof. It is natural to extend that idea to _Generic so that it can also accept a type for the first operand. This type does not undergo any conversions, which allows it to match qualified types, incomplete types, and function types. C2x has the typeof operator as a way to get the type of an expression before lvalue conversion takes place, and so it keeps the qualification. This makes typeof a straightforward approach to determining a type operand for _Generic that considers qualifiers. This allows writing a helper macro like:
#define EXPR_HAS_TYPE(Expr, Type) _Generic(typeof(Expr), Type : 1, default : 0)
which can be called with an expression of any value category (no need to be an lvalue) and will test against (almost) any type. This is a conforming extension to C (it's defining the behavior of invalid syntax), and I believe this is a natural way to extend this functionality.
_Generic with a type operand will relax the requirements of what can be a valid association. Specifically, it allows incomplete types and non-object types (but still prevents use of variably-modified types). This relaxation only happens for the type operand form; the expression operand form continues to behave as it always has.
This extension allows incomplete and non-object types because the goal is to better enable type-generic programming in C, and so we want to allow any typed construct we can statically determine the type of. There is no reason to prevent matching against void or function types, but this does explain why we continue to prohibit variably-modified types.
Please see the RFC at https://discourse.llvm.org/t/rfc-generic-selection-expression-with-a-type-operand/70388 for more details.
I realize this is a rarely used type, but should these be bitfielded somehow? Particularly now that you're adding a 'bool' field?