| 1 |
// Compiled on macOS using: |
| 2 |
// 1. clang++ -c -std=c++2a -gdwarf-4 -O0 -o accel-imported-declaration.macho-arm64.o |
| 3 |
// 2. clang++ -Wl,-oso_prefix=$PWD accel-imported-declaration.macho-arm64.o -o accel-imported-declaration.macho-arm64 |
| 4 |
// |
| 5 |
// In step 2 it's important to strip the absolute object file paths |
| 6 |
// |
| 7 |
// Verify that the OSO path isn't absolute using `nm -ap accel-imported-declaration.macho-arm64` |
| 8 |
|
| 9 |
namespace A { |
| 10 |
namespace B { |
| 11 |
namespace C { |
| 12 |
int a = -1; |
| 13 |
} // namespace C |
| 14 |
} // namespace B |
| 15 |
|
| 16 |
namespace C = B::C; |
| 17 |
|
| 18 |
using namespace B::C; |
| 19 |
using B::C::a; |
| 20 |
} // namespace A |
| 21 |
|
| 22 |
int main() { return A::a; } |