|
1 |
| -// RUN: c-index-test core -print-source-symbols -- %s -std=c++14 -target x86_64-apple-macosx10.7 | FileCheck %s |
| 1 | +// RUN: c-index-test core -print-source-symbols -- %s -std=c++1z -target x86_64-apple-macosx10.7 | FileCheck %s |
2 | 2 |
|
3 | 3 | // CHECK: [[@LINE+1]]:7 | class/C++ | Cls | [[Cls_USR:.*]] | <no-cgname> | Def | rel: 0
|
4 | 4 | class Cls { public:
|
@@ -449,3 +449,29 @@ void staticAssertInFn() {
|
449 | 449 | // CHECK: [[@LINE-3]]:17 | struct/C++ | StaticAssertRef | c:@S@StaticAssertRef | <no-cgname> | Ref,RelCont | rel: 1
|
450 | 450 | // CHECK-NEXT: RelCont | staticAssertInFn | c:@F@staticAssertInFn#
|
451 | 451 | }
|
| 452 | + |
| 453 | +namespace cpp17structuredBinding { |
| 454 | + |
| 455 | +struct Cpp17StructuredBinding { |
| 456 | + int x, y; |
| 457 | + |
| 458 | + Cpp17StructuredBinding(int x, int y): x(x), y(y) { } |
| 459 | +}; |
| 460 | + |
| 461 | +auto [structuredBinding1, structuredBinding2] = Cpp17StructuredBinding(Record::C, 0); |
| 462 | +// CHECK: [[@LINE-1]]:7 | variable/C++ | structuredBinding1 | c:@N@cpp17structuredBinding@structuredBinding1 | <no-cgname> | Decl,RelChild | rel: 1 |
| 463 | +// CHECK-NEXT: RelChild | cpp17structuredBinding | c:@N@cpp17structuredBinding |
| 464 | +// CHECK: [[@LINE-3]]:27 | variable/C++ | structuredBinding2 | c:@N@cpp17structuredBinding@structuredBinding2 | <no-cgname> | Decl,RelChild | rel: 1 |
| 465 | +// CHECK-NEXT: RelChild | cpp17structuredBinding | c:@N@cpp17structuredBinding |
| 466 | + |
| 467 | +void localStructuredBindingAndRef() { |
| 468 | + int ref = structuredBinding1; |
| 469 | +// CHECK: [[@LINE-1]]:13 | variable/C++ | structuredBinding1 | c:@N@cpp17structuredBinding@structuredBinding1 | <no-cgname> | Ref,Read,RelCont | rel: 1 |
| 470 | +// CHECK-NEXT: RelCont | localStructuredBindingAndRef | c:@N@cpp17structuredBinding@F@localStructuredBindingAndRef# |
| 471 | + auto [localBinding1, localBinding2] = Cpp17StructuredBinding(ref, structuredBinding2); |
| 472 | +// CHECK: [[@LINE-1]]:69 | variable/C++ | structuredBinding2 | c:@N@cpp17structuredBinding@structuredBinding2 | <no-cgname> | Ref,Read,RelCont | rel: 1 |
| 473 | +// CHECK-NEXT: RelCont | localStructuredBindingAndRef | c:@N@cpp17structuredBinding@F@localStructuredBindingAndRef# |
| 474 | +// CHECK-NOT: localBinding |
| 475 | +} |
| 476 | + |
| 477 | +} |
0 commit comments