| 1 | // RUN: clang-reorder-fields -record-name bar::Derived -fields-order z,y %s -- | FileCheck %s |
| 2 | |
| 3 | namespace bar { |
| 4 | class Base { |
| 5 | public: |
| 6 | Base(int nx, int np) : x(nx), p(np) {} |
| 7 | int x; |
| 8 | int p; |
| 9 | }; |
| 10 | |
| 11 | |
| 12 | class Derived : public Base { |
| 13 | public: |
| 14 | Derived(long ny); |
| 15 | Derived(char nz); |
| 16 | private: |
| 17 | long y; |
| 18 | char z; |
| 19 | }; |
| 20 | |
| 21 | Derived::Derived(long ny) : |
| 22 | Base(ny, 0), |
| 23 | y(ny), // CHECK: {{^ z\(static_cast<char>\(ny\)\),}} |
| 24 | z(static_cast<char>(ny)) // CHECK-NEXT: {{^ y\(ny\)}} |
| 25 | {} |
| 26 | |
| 27 | Derived::Derived(char nz) : |
| 28 | Base(1, 2), |
| 29 | y(nz), // CHECK: {{^ z\(x\),}} |
| 30 | z(x) // CHECK-NEXT: {{^ y\(nz\)}} |
| 31 | {} |
| 32 | |
| 33 | } // namespace bar |
| 34 | |