
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.
15 lines
327 B
C++
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
|
|
}
|
|
}
|