summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-reorder-fields/CStructAmbiguousName.cpp
blob: e1e6645511d8c96de5830339730dc75354eddb18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// RUN: clang-reorder-fields -record-name ::Foo -fields-order y,x %s -- | FileCheck %s

struct Foo {
  int x;    // CHECK:      {{^  double y;}}
  double y; // CHECK-NEXT: {{^  int x;}}
};

namespace bar {
struct Foo {
  int x;    // CHECK:      {{^  int x;}}
  double y; // CHECK-NEXT: {{^  double y;}}
};
} // end namespace bar

int main() {
  bar::Foo foo = { 1, 1.7 }; // CHECK: {{^  bar::Foo foo = { 1, 1.7 };}}
  return 0;
}
OpenPOWER on IntegriCloud