summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/Core/index-source.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2018-10-09 01:02:56 +0000
committerFangrui Song <maskray@google.com>2018-10-09 01:02:56 +0000
commit63a8b6c3046d2aaa83f1410c32771e7eb21e7a6c (patch)
tree369842da4afd9a33113f87937700ec7b0cf5050e /clang/test/Index/Core/index-source.cpp
parent03128d62b85a737ae6005a226693d472192a740f (diff)
downloadbcm5719-llvm-63a8b6c3046d2aaa83f1410c32771e7eb21e7a6c.tar.gz
bcm5719-llvm-63a8b6c3046d2aaa83f1410c32771e7eb21e7a6c.zip
[Index] Use locations to uniquify function-scope BindingDecl USR
Summary: This makes BindingDecl's of the same name have different USRs, so that references can be correctly attributed. int a[1] = {}; { auto [x] = a; x; } { auto [x] = a; x; } Reviewers: akyrtzi, arphaman, rsmith, hokein Reviewed By: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52445 llvm-svn: 344010
Diffstat (limited to 'clang/test/Index/Core/index-source.cpp')
-rw-r--r--clang/test/Index/Core/index-source.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/Index/Core/index-source.cpp b/clang/test/Index/Core/index-source.cpp
index 6f485feb47c..0bf663e30be 100644
--- a/clang/test/Index/Core/index-source.cpp
+++ b/clang/test/Index/Core/index-source.cpp
@@ -1,4 +1,5 @@
// RUN: c-index-test core -print-source-symbols -- %s -std=c++1z -target x86_64-apple-macosx10.7 | FileCheck %s
+// RUN: c-index-test core -print-source-symbols -include-locals -- %s -std=c++1z -target x86_64-apple-macosx10.7 | FileCheck -check-prefix=LOCAL %s
// CHECK: [[@LINE+1]]:7 | class/C++ | Cls | [[Cls_USR:.*]] | <no-cgname> | Def | rel: 0
class Cls { public:
@@ -493,6 +494,7 @@ void localStructuredBindingAndRef() {
// CHECK: [[@LINE-1]]:69 | variable/C++ | structuredBinding2 | c:@N@cpp17structuredBinding@structuredBinding2 | <no-cgname> | Ref,Read,RelCont | rel: 1
// CHECK-NEXT: RelCont | localStructuredBindingAndRef | c:@N@cpp17structuredBinding@F@localStructuredBindingAndRef#
// CHECK-NOT: localBinding
+// LOCAL: [[@LINE-4]]:9 | variable(local)/C++ | localBinding1 | c:index-source.cpp@25382@N@cpp17structuredBinding@F@localStructuredBindingAndRef#@localBinding1
}
}
OpenPOWER on IntegriCloud