pub struct DeclSpecifiers {
pub storage: Option<Spanned<StorageClass>>,
pub thread_local: Option<SourceRange>,
pub inline: bool,
pub noreturn: Option<SourceRange>,
pub alignas: Vec<Alignment>,
pub attrs: Attributes,
pub base: Type,
pub range: SourceRange,
}Expand description
The declaration specifiers shared by all declarators of one declaration.
Fields§
§storage: Option<Spanned<StorageClass>>The storage class, if one was written.
thread_local: Option<SourceRange>Where _Thread_local, C23’s thread_local or GNU’s __thread was
written, if it was.
It is not a StorageClass, because C11 6.7.1p2 lets it appear
beside one: static _Thread_local int x; names a thread-local object
with internal linkage, and at block scope one of static or extern
is required (6.7.1p3).
inline: boolWhether inline was written.
noreturn: Option<SourceRange>Whether the declaration was marked _Noreturn, [[noreturn]] or
__cinrs_noreturn.
alignas: Vec<Alignment>The alignment specifiers written among these declaration specifiers, in the order they were written.
C11 6.7.5p6 allows several and makes the strictest of them the one that
holds, so they are all kept; __attribute__((aligned(N))) written here
asks for the same thing and is folded in, with
Alignment::from_attribute saying which spelling each one came from.
attrs: AttributesWhat __attribute__((…)) and [[…]] asked for.
base: TypeThe base type built from the type specifiers and qualifiers.
range: SourceRangeWhere the specifiers were written.
Implementations§
Source§impl DeclSpecifiers
impl DeclSpecifiers
Sourcepub fn is_typedef(&self) -> bool
pub fn is_typedef(&self) -> bool
Whether this declaration introduces typedef names.