llvm-project/clang/test/Index/using_if_exists.cpp
Ben Barham 089b6efefc [Index] Remove reference to UnresolvedUsingIfExists
Assuming `ns::foo` doesn't exist, given:
```
using ns::foo __attribute__((using_if_exists));
```

The AST will look something like:
UsingDecl
  UsingShadowDecl
    UnresolvedUsingIfExistsDecl

Thus we end up adding a reference to `UnresolvedUsingIfExistsDecl` when
processing `UsingDecl`, but never add the decl itself. In this case the
decl is really the `UsingDecl` anyway though (which we do output), so it
makes more sense to just remove the extra reference.

Differential Revision: https://reviews.llvm.org/D124288
2022-04-22 17:19:33 -07:00

10 lines
297 B
C++

// RUN: c-index-test core -print-source-symbols -- %s -target x86_64-unknown-unknown 2>&1 | FileCheck %s
namespace ns {
// void foo();
}
using ns::foo __attribute__((using_if_exists));
// CHECK: [[@LINE-1]]:11 | using/C++ | foo | c:@UD@foo | <no-cgname> | Decl | rel: 0
// CHECK-NOT: <unknown>