1// RUN: clang-reorder-fields -record-name Foo -fields-order c,e1,e3,e2,a,b %s -- | FileCheck %s
2
3class Foo {
4 int a; // Trailing comment for a.
5 int b; // Multiline
6 // trailing for b.
7 // Prefix comments for c.
8 int c;
9
10 /*c-like*/ int e1;
11 int /*c-like*/ e2;
12 int e3 /*c-like*/;
13};
14
15// Note: the position of the empty line is somewhat arbitrary.
16
17// CHECK: // Prefix comments for c.
18// CHECK-NEXT: int c;
19// CHECK-NEXT: /*c-like*/ int e1;
20// CHECK-NEXT: int e3 /*c-like*/;
21// CHECK-EMPTY:
22// CHECK-NEXT: int /*c-like*/ e2;
23// CHECK-NEXT: int a; // Trailing comment for a.
24// CHECK-NEXT: int b; // Multiline
25// CHECK-NEXT: // trailing for b.
26
27

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of clang-tools-extra/test/clang-reorder-fields/Comments.cpp