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

NameValueComment
IDNS_Label1Labels, declared with 'x:' and referenced with 'goto x'.
IDNS_Tag2Tags, 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_Type4Types, 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_Member8Members, 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_Namespace16Namespaces, declared with 'namespace foo {}'. Lookup for nested-name-specifiers find these.
IDNS_Ordinary32Ordinary names. In C, everything that's not a label, tag, member, or function-local extern ends up here.
IDNS_ObjCProtocol64Objective C @ protocol.
IDNS_OrdinaryFriend128This 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_TagFriend256This 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_Using512This 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_NonMemberOperator1024This 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_LocalExtern2048This 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_OMPReduction4096This declaration is an OpenMP user defined reduction construction.
IDNS_OMPMapper8192This declaration is an OpenMP user defined mapper.