
Add checks to prevent rewriting when doing so might result in incorrect code. The following cases are checked: - There are multiple field declarations in one statement like `int a, b` - Multiple fields are created from a single macro expansion - Preprocessor directives are present in the struct
12 lines
277 B
C++
12 lines
277 B
C++
// RUN: clang-reorder-fields -record-name ::bar::Foo -fields-order z,y,x %s -- | FileCheck %s
|
|
|
|
namespace bar {
|
|
|
|
// The order of fields should not change.
|
|
struct Foo {
|
|
int x, y; // CHECK: {{^ int x, y;}}
|
|
double z; // CHECK-NEXT: {{^ double z;}}
|
|
};
|
|
|
|
} // end namespace bar
|