1 // RUN: %clang_cc1 -ast-print -verify -triple=x86_64-pc-win32 -fms-compatibility %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -triple=x86_64-pc-win32 -fms-compatibility -emit-pch -o %t %s
3 // RUN: %clang_cc1 -triple=x86_64-pc-win32 -fms-compatibility -include-pch %t -verify %s -ast-print -o - | FileCheck %s
4 // expected-no-diagnostics
14 Test1(int x
) : x_(x
) {}
15 __declspec(property(get
= get_x
)) int X
;
16 int get_x() const { return x_
; }
17 static Test1
*GetTest1() { return new Test1(10); }
22 __declspec(property(get
=GetX
,put
=PutX
)) int x
[];
23 int GetX(int i
, int j
) { return i
+j
; }
24 void PutX(int i
, int j
, int k
) { j
= i
= k
; }
30 __declspec(property(get
=GetX
,put
=PutX
)) T x
[];
31 T
GetX(T i
, T j
) { return i
+j
; }
32 T
PutX(T i
, T j
, T k
) { return j
= i
= k
; }
33 ~St() { x
[0][0] = x
[1][1]; }
36 // CHECK: this->x[0][0] = this->x[1][1];
37 // CHECK: this->x[0][0] = this->x[1][1];
40 int main(int argc
, char **argv
) {
45 // CHECK-NEXT: int j = (p1->x)[223][11];
46 int j
= (p1
->x
)[223][11];
47 // CHECK-NEXT: (p1->x[23])[1] = j;
49 // CHECK-NEXT: float j1 = (p2->x[223][11]);
50 float j1
= (p2
->x
[223][11]);
51 // CHECK-NEXT: ((p2->x)[23])[1] = j1;
52 ((p2
->x
)[23])[1] = j1
;
53 // CHECK-NEXT: ++(((p2->x)[23])[1]);
55 // CHECK-NEXT: j1 = ((p2->x)[23])[1] = j1;
56 j1
= ((p2
->x
)[23])[1] = j1
;
57 // CHECK-NEXT: return Test1::GetTest1()->X;
58 return Test1::GetTest1()->X
;