1 // RUN: clang-reorder-fields -record-name Foo -fields-order s1,x,z,s2 %s -- | FileCheck %s
2
3 class Foo {
4 public:
5 Foo();
6
7 private:
8 int x; // CHECK: {{^ const char \*s1;}}
9 const char *s1; // CHECK-NEXT: {{^ int x;}}
10 const char *s2; // CHECK-NEXT: {{^ double z;}}
11 double z; // CHECK-NEXT: {{^ const char \*s2;}}
12 };
13
Foo()14 Foo::Foo():
15 x(12), // CHECK: {{^ s1\("abc"\),}}
16 s1("abc"), // CHECK-NEXT: {{^ x\(12\),}}
17 s2("def"), // CHECK-NEXT: {{^ z\(3.14\),}}
18 z(3.14) // CHECK-NEXT: {{^ s2\("def"\)}}
19 {}
20
main()21 int main() {
22 Foo foo;
23 return 0;
24 }
25