[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeCompletion / member-access.c
blobfc54993152815817b2a1cab4c2d439eb99e226e5
1 struct Point {
2 float x;
3 float y;
4 float z;
5 };
7 void test(struct Point *p) {
8 p->
9 // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):6 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
10 // CHECK-CC1: x
11 // CHECK-CC1: y
12 // CHECK-CC1: z
15 struct Point2 {
16 float x;
19 void test2(struct Point2 p) {
20 p->
23 void test3(struct Point2 *p) {
27 // RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:%(line-7):6 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
28 // CHECK-CC2: x (requires fix-it: {[[@LINE-8]]:4-[[@LINE-8]]:6} to ".")
30 // RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:%(line-6):5 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s
31 // CHECK-CC3: x (requires fix-it: {[[@LINE-7]]:4-[[@LINE-7]]:5} to "->")
33 void test4(struct Point *p) {
34 (int)(p)->x;
35 (int)(0,1,2,3,4,p)->x;
37 // RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:%(line-3):13 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
38 // RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:%(line-3):23 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s