def recordDecl(*args):
    """Matches class, struct, and union declarations.

    >>> from glud import *
    >>> config = '''
    ...  class W;
    ...  template<typename T> class X {};
    ...  struct Y {};
    ...  union Z {};
    ... '''
    >>> m = recordDecl()
    >>> for c in walk(m, parse_string(config).cursor):
    ...     print(c.spelling)
    W
    X
    Y
    Z
    """
    kinds = [
        CursorKind.STRUCT_DECL,
        CursorKind.UNION_DECL,
        CursorKind.CLASS_DECL,
        CursorKind.CLASS_TEMPLATE,
    ]
    inner = [ PredMatcher(is_kind(k)) for k in kinds ]
    return allOf(anyOf(*inner), *args)