isTransparentContext - Determines whether this context is a "transparent" context, meaning that the members declared in this context are semantically declared in the nearest enclosing non-transparent (opaque) context but are lexically declared in this context. More...

getPrimaryContext - There may be many different declarations of the same entity (including forward declarations of classes, multiple definitions of namespaces, etc.), each with a different set of declarations. More...

getDefinition - Returns the TagDecl that actually defines this struct/union/class/enum.

When determining whether or not a struct/union/class/enum has a definition, one should use this method as opposed to 'isDefinition'. 'isDefinition' indicates whether or not a specific TagDecl is defining declaration, not whether or not the struct/union/class/enum type is defined. This method returns NULL if there is no TagDecl that defines the struct/union/class/enum.

Is this tag type named, either directly or via being defined in a typedef of this type?

C++11 [basic.link]p8: A type is said to have linkage if and only if:

it is a class or enumeration type that is named (or has a name for linkage purposes) and the name has linkage; ... C++11 [dcl.typedef]p9: If the typedef declaration defines an unnamed class (or enum), the first typedef-name declared by the declaration to be that class type (or enum type) is used to denote the class type (or enum type) for linkage purposes only.

C does not have an analogous rule, but the same concept is nonetheless useful in some places.