pub enum TypeSpec {
None,
Builtin(Builtin),
Record {
kind: RecordKind,
tag: Option<Symbol>,
fields: Option<MemberList>,
attrs: AttrList,
},
Enum {
tag: Option<Symbol>,
enumerators: Option<EnumeratorList>,
underlying: Option<TypeNameId>,
attrs: AttrList,
},
Typedef(Symbol),
Typeof {
unqual: bool,
operand: TypeofArg,
},
Atomic(TypeNameId),
Auto(Deduction),
}Expand description
What type a declaration named.
Variants§
None
Nothing was written, which is int before C23 with a warning and an error in it.
Builtin(Builtin)
One or more of the keywords that name a built-in type.
Record
struct or union, with or without a tag, with or without a body.
Fields
kind: RecordKindWhich of the two.
fields: Option<MemberList>The members, absent when this is a reference to a tag rather than a definition. An
empty list is a definition of an empty structure, which is a GNU extension, so the
difference between struct S; and struct S {}; has to survive.
Enum
enum, with C23’s optional underlying type.
Fields
enumerators: Option<EnumeratorList>The enumerators, absent when this is a reference rather than a definition.
underlying: Option<TypeNameId>The : T that C23 added, which fixes the representation instead of leaving it to
the implementation.
Typedef(Symbol)
An identifier the parser’s scope stack said was a typedef name.
Typeof
typeof or typeof_unqual, or their __typeof__ spellings.
Fields
Atomic(TypeNameId)
_Atomic(T), the type constructor rather than the qualifier.
Auto(Deduction)
A type deduced from an initializer, which is C23’s auto and GNU’s __auto_type.