Files
clang-p2996/lldb/test/API/commands/expression/namespace-alias/main.cpp
Michael Buch 6e10e6cb8f Reland "[lldb][DWARFASTParserClang] Correctly resolve imported namespaces during expression evaluation"
This relands a patch previously reverted
in `181d6e24ca3c09bfd6ec7c3b20affde3e5ea9b40`.
This wasn't quite working on Linux because we
weren't populating the manual DWARF index with
`DW_TAG_imported_declaration`. The relanded patch
does this.

**Summary**

This patch makes the expression evaluator understand
namespace aliases.

This will become important once `std::ranges` become
more widespread since `std::views` is defined as:

```
namespace std {
namespace ranges::views {}

namespace views = ranges::views;
}
```

**Testing**

* Added API test

Differential Revision: https://reviews.llvm.org/D143398
2023-02-13 16:58:05 +00:00

22 lines
324 B
C++

namespace A {
inline namespace _A {
namespace B {
namespace C {
int a = -1;
int func() { return 0; }
} // namespace C
} // namespace B
namespace C = B::C;
namespace D = B::C;
} // namespace _A
} // namespace A
namespace E = A;
namespace F = E::C;
namespace G = F;
int main(int argc, char **argv) { return A::B::C::a; }