Expand description
The GNU extensions’ name tables.
Two questions are asked of this module, and it matters that both are
answered from the same place: the parser and
sema ask “what does this attribute or builtin mean?”, and the
preprocessor answers __has_attribute, __has_builtin,
__has_feature and __has_extension from it — so a program that guards a
construct with #if __has_attribute(packed) gets an answer that is true of
this implementation rather than of GCC’s.
The one set of names that is not here is the atomic builtins’, which
live beside the code that implements them in
crate::sema::is_atomic_builtin — for the same reason: one table, asked
by both.
doc/gnu-extensions.md is the prose version of the same tables.
Enums§
- Attribute
- What an
__attribute__(or a C23[[…]]) asks for.
Constants§
- CINRS_
ATTRIBUTES - The names
[[cinrs::…]]knows, for the diagnostic that lists them. - LIBRARY_
BUILTINS - The library functions
__builtin_Xmay name. - SPECIAL_
BUILTINS - The builtins the front end implements itself.
- UNSUPPORTED_
ATTRIBUTES - The attributes that are refused rather than ignored, with the reason.
Functions§
- attribute
- The attribute a name spells, accepting both the
nameand the__name__forms GCC does. - cinrs_
attribute - What a
[[cinrs::name]]attribute asks for. - has_
attribute - Whether
__has_attribute(name)answers yes. - has_
builtin - Whether
__has_builtin(name)answers yes. - has_
c_ attribute - The value
__has_c_attribute(name)answers with. - has_
feature - Whether
__has_feature(name)/__has_extension(name)answers yes. - long_
double_ math - The maths functions whose
long doubleform is thedoubleone here. - typed_
overflow - The operation a typed overflow builtin performs, if the name spells one.
- unsupported_
reason - The reason an
Attribute::Unsupportedone is refused.