https://bugs.llvm.org/show_bug.cgi?id=47635
Bug ID: 47635
Summary: Add clang-format option to only add a single
continuation ident
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Formatter
Assignee: unassignedclangb...@nondot.org
Reporter: arichardson....@gmail.com
CC: djas...@google.com, kli...@google.com,
llvm-bugs@lists.llvm.org
Currently clang-format will add a new continuationIdent for each nested paren,
but some project styles (e.g. FreeBSD) want a single continuation indent.
Example:
if (sscanf(ln + 16, "%d %d %d %d", &fbbw, &fbbh, &fbbox,
&fbboy) != 4)
is reformatted to:
if (sscanf(ln + 16, "%d %d %d %d", &fbbw, &fbbh, &fbbox,
&fbboy) != 4)
Clang-format adds another 4 spaces (continuation ident) for the nested scanf()
call, but the correct style would be to only add a single continuation indent.
See https://reviews.freebsd.org/D26340 for the examples that prompted this bug
report.
I think the existing behaviour makes sense, so fixing this would probably
require
a new format option to only indent once.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs