[PATCH] D141694: [clang-format] SortUsingDeclarations support lexicographic order
Björn Schäpers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 13 12:14:25 PST 2023
HazardyKnusperkeks added reviewers: owenpan, HazardyKnusperkeks.
HazardyKnusperkeks added a comment.
Looks ok for me.
================
Comment at: clang/include/clang/Format/Format.h:3500
+ /// \code
+ /// using std::c;
+ /// using std::b;
----------------
You should use the same example lines as for the other options.
================
Comment at: clang/lib/Format/UsingDeclarationsSorter.cpp:154-158
+ auto comp = [SortUsingDeclarations](const UsingDeclaration &lhs,
+ const UsingDeclaration &rhs) -> bool {
+ return compareLabels(lhs.Label, rhs.Label, SortUsingDeclarations) < 0;
+ };
+ llvm::stable_sort(SortedUsingDeclarations, comp);
----------------
Use capital letters for variables and arguments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141694/new/
https://reviews.llvm.org/D141694
More information about the cfe-commits
mailing list