19 lines · cpp
1// RUN: clang-reorder-fields -record-name ::Foo -fields-order y,x %s -- | FileCheck %s2 3struct Foo {4 int x; // CHECK: {{^ double y;}}5 double y; // CHECK-NEXT: {{^ int x;}}6};7 8namespace bar {9struct Foo {10 int x; // CHECK: {{^ int x;}}11 double y; // CHECK-NEXT: {{^ double y;}}12};13} // end namespace bar14 15int main() {16 bar::Foo foo = { 1, 1.7 }; // CHECK: {{^ bar::Foo foo = { 1, 1.7 };}}17 return 0;18}19