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