[PATCH] D116229: [clang-format] Add option to align pointers in C style casts differently
Björn Schäpers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 23 12:16:20 PST 2021
HazardyKnusperkeks added inline comments.
================
Comment at: clang/lib/Format/TokenAnnotator.cpp:3045
+ // parenthesis of a cast we know we are in a cast.
+ if (!Left.isOneOf(TT_PointerOrReference, tok::l_paren))
+ for (const FormatToken *Tok = &Right;
----------------
What are `Left` and `Right` in your cases? I don't like the loop here and am not sure what exactly you want to check. Shouldn't `Left` be the `PointerOrReference` and `Right` is a `r_paren`?
================
Comment at: clang/unittests/Format/FormatTest.cpp:15346
+TEST_F(FormatTest, AlignPointersInCasts) {
+ FormatStyle Style = getLLVMStyle();
----------------
I think you should add some tests with simpler casts too.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116229/new/
https://reviews.llvm.org/D116229
More information about the cfe-commits
mailing list