llvm-project/clang/test/Index/USR/decl-context.cpp
kadir çetinkaya 48a53509e8
[clang][USR] Encode full decl-context also for anon namespaces (#68325)
Otherwise we create collisions, e.g. a struct named Foo inside an
anonymous
namespace will get the same USR no matter what the surrounding
decl-context is.
2023-10-18 10:51:31 +02:00

15 lines
327 B
C++

// RUN: c-index-test core -print-source-symbols -- -std=c++20 %s | FileCheck %s
namespace ns {
namespace {
struct Foo {};
// CHECK: [[@LINE-1]]:8 | struct/C | Foo | c:decl-context.cpp@N@ns@aN@S@Foo
}
}
namespace ns2 {
namespace {
struct Foo {};
// CHECK: [[@LINE-1]]:8 | struct/C | Foo | c:decl-context.cpp@N@ns2@aN@S@Foo
}
}