enum Decl::IdentifierNamespace
Description
IdentifierNamespace - The different namespaces in which declarations may appear. According to C99 6.2.3, there are four namespaces, labels, tags, members and ordinary identifiers. C++ describes lookup completely differently: certain lookups merely "ignore" certain kinds of declarations, usually based on whether the declaration is of a type, etc. These are meant as bitmasks, so that searches in C++ can look into the "tag" namespace during ordinary lookup. Decl currently provides 15 bits of IDNS bits.
Declared at: clang/include/clang/AST/DeclBase.h:112
Enumerators
Name | Value | Comment |
---|---|---|
IDNS_Label | 1 | Labels, declared with 'x:' and referenced with 'goto x'. |
IDNS_Tag | 2 | Tags, declared with 'struct foo;' and referenced with 'struct foo'. All tags are also types. This is what elaborated-type-specifiers look for in C. This also contains names that conflict with tags in the same scope but that are otherwise ordinary names (non-type template parameters and indirect field declarations). |
IDNS_Type | 4 | Types, declared with 'struct foo', typedefs, etc. This is what elaborated-type-specifiers look for in C++, but note that it's ill-formed to find a non-tag. |
IDNS_Member | 8 | Members, declared with object declarations within tag definitions. In C, these can only be found by "qualified" lookup in member expressions. In C++, they're found by normal lookup. |
IDNS_Namespace | 16 | Namespaces, declared with 'namespace foo {}'. Lookup for nested-name-specifiers find these. |
IDNS_Ordinary | 32 | Ordinary names. In C, everything that's not a label, tag, member, or function-local extern ends up here. |
IDNS_ObjCProtocol | 64 | Objective C @ protocol. |
IDNS_OrdinaryFriend | 128 | This declaration is a friend function. A friend function declaration is always in this namespace but may also be in IDNS_Ordinary if it was previously declared. |
IDNS_TagFriend | 256 | This declaration is a friend class. A friend class declaration is always in this namespace but may also be in IDNS_Tag|IDNS_Type if it was previously declared. |
IDNS_Using | 512 | This declaration is a using declaration. A using declaration *introduces* a number of other declarations into the current scope, and those declarations use the IDNS of their targets, but the actual using declarations go in this namespace. |
IDNS_NonMemberOperator | 1024 | This declaration is a C++ operator declared in a non-class context. All such operators are also in IDNS_Ordinary. C++ lexical operator lookup looks for these. |
IDNS_LocalExtern | 2048 | This declaration is a function-local extern declaration of a variable or function. This may also be IDNS_Ordinary if it has been declared outside any function. These act mostly like invisible friend declarations, but are also visible to unqualified lookup within the scope of the declaring function. |
IDNS_OMPReduction | 4096 | This declaration is an OpenMP user defined reduction construction. |
IDNS_OMPMapper | 8192 | This declaration is an OpenMP user defined mapper. |