View source code
Display the source code in dmd/attrib.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Module dmd.attrib

Defines declarations of various attributes.

The term 'attribute' refers to things that can apply to a larger scope than a single declaration. Among them are: - Alignment (align(8)) - User defined attributes (@UDA) - Function Attributes (@safe) - Storage classes (static, __gshared) - Mixin declarations (mixin("int x;")) - Conditional compilation (static if, static foreach) - Linkage (extern(C)) - Anonymous structs / unions - Protection (private, public) - Deprecated declarations (@deprecated)




foreachUdaNoSemantic(sym, dg) Iterates the UDAs attached to the given symbol, without performing semantic analysis.
isCoreUda(sym, ident) Returns true if the given symbol is a symbol declared in core.attribute and has the given identifier.
isEnumAttribute(e, id)


AlignDeclaration Alignment attribute for aggregates, members and variables.
AnonDeclaration An anonymous struct/union (defined by isunion).
AttribDeclaration Abstract attribute applied to Dsymbol's used as a common ancestor for storage classes (StorageClassDeclaration), linkage (LinkageDeclaration) and others.
ConditionalDeclaration A conditional compilation declaration, used for version / debug and specialized for static if.
CPPMangleDeclaration Attribute declaring whether an external aggregate should be mangled as a struct or class in C++, e.g. extern(C++, struct) class C { ... }. This is required for correct name mangling on MSVC targets, see cppmanglewin.d for details.
CPPNamespaceDeclaration A node to represent an extern(C++) namespace attribute
DeprecatedDeclaration Deprecation with an additional message applied to Dsymbols, e.g. deprecated("Superseeded by foo") int bar;. (Note that deprecated int bar; is currently represented as a StorageClassDeclaration with STC.deprecated_)
ForwardingAttribDeclaration Collection of declarations that stores foreach index variables in a local symbol table. Other symbols declared within are forwarded to another scope, like:
LinkDeclaration Linkage attribute applied to Dsymbols, e.g. extern(C) void foo().
MixinDeclaration Mixin declarations, like: mixin("int x");
PragmaDeclaration Pragma applied to Dsymbols, e.g. pragma(inline, true) void foo, but not PragmaStatement's like pragma(msg, "hello");.
StaticForeachDeclaration Static foreach at declaration scope, like: static foreach (i; [0, 1, 2]){ }
StaticIfDeclaration ` { static if () { } else { } }`
StorageClassDeclaration Storage classes applied to Dsymbols, e.g. const int i;
UserAttributeDeclaration User defined attributes look like: @foo(args, ...) @(args, ...)
VisibilityDeclaration Visibility declaration for Dsymbols, e.g. public int i;


Walter Bright


Boost License 1.0