Track the scope we are currently in to build a properly scoped variable. More...
#include "InsightsHelpers.h"


Public Member Functions | |
| ScopeHelper (const size_t len) | |
Public Attributes | |
| const size_t | mLength |
| Length of the scope as it was before this declaration was appended. | |
Public Attributes inherited from StackListEntry< ScopeHelper > | |
| StackListEntry * | next |
| StackListEntry * | prev |
Track the scope we are currently in to build a properly scoped variable.
The AST only knows about absolute scopes (namespace, struct, class), as once a declaration is parsed it is either in a scope or not. Each request to give me the namespace automatically leads to the entire scope the item is in. This makes it hard to have constructs like this:
Here the initializer of a is in the scope One::Two::d. At this point the qualification Two::d is enought.
ScopeHelper tracks whether we are currently in a class or namespace and simply remove the path we already in from the scope.
Definition at line 246 of file InsightsHelpers.h.
|
inline |
Definition at line 248 of file InsightsHelpers.h.
| const size_t clang::insights::ScopeHelper::mLength |
Length of the scope as it was before this declaration was appended.
Definition at line 253 of file InsightsHelpers.h.