[clang-tools-extra] [clang-reorder-fields] Move trailing comments. (PR #122918)

Clement Courbet via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 15 00:45:49 PST 2025


================
@@ -116,26 +118,78 @@ findMembersUsedInInitExpr(const CXXCtorInitializer *Initializer,
   return Results;
 }
 
-/// Returns the full source range for the field declaration up to (not
-/// including) the trailing semicolumn, including potential macro invocations,
-/// e.g. `int a GUARDED_BY(mu);`.
+/// Returns the next token after `Loc` (including comment tokens).
+static std::optional<Token> getTokenAfter(SourceLocation Loc,
----------------
legrosbuffle wrote:

Thanks for the pointer, I looked at the code in clang-format as I expected to find something like this there, but I did not think of clang-tidy.  I'll send a followup to move the code to `Lexer.h`.

https://github.com/llvm/llvm-project/pull/122918


More information about the cfe-commits mailing list