[clang] [clang-format] add option to control bin-packing keyworded parameters (PR #131605)
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 30 02:46:38 PDT 2025
================
@@ -3783,10 +3823,20 @@ void TokenAnnotator::annotate(AnnotatedLine &Line) {
static bool isFunctionDeclarationName(const LangOptions &LangOpts,
const FormatToken &Current,
const AnnotatedLine &Line,
+ const FormatStyle &Style,
FormatToken *&ClosingParen) {
if (Current.is(TT_FunctionDeclarationName))
return true;
+ if (Current.is(TT_FunctionLikeOrFreestandingMacro) &&
+ std::find_if(
+ Style.KeywordedFunctionLikeMacros.begin(),
+ Style.KeywordedFunctionLikeMacros.end(),
+ [&Current](const FormatStyle::KeywordedFunctionLikeMacro &Decl) {
+ return Current.TokenText == Decl.Name;
+ }) != Style.KeywordedFunctionLikeMacros.end()) {
+ return true;
+ }
----------------
owenca wrote:
It doesn't seem to make sense to annotate `Q_Property` as `TT_FunctionDeclarationName`. Why is this necessary?
https://github.com/llvm/llvm-project/pull/131605
More information about the cfe-commits
mailing list