================ @@ -335,6 +336,32 @@ class LineJoiner { } } + if (Style.AllowShortFunctionsOnASingleLine == + FormatStyle::SFS_StaticInlineOnly || + Style.AllowShortFunctionsOnASingleLine == + FormatStyle::SFS_StaticInline) { + // Check if the current line belongs to a static inline function + const auto *FirstNonCommentToken = + TheLine ? TheLine->getFirstNonComment() : nullptr; + + // Look for 'static' and 'inline' keywords in any order + bool HasStatic = false; + bool HasInline = false; + const FormatToken *Tok = FirstNonCommentToken; + + while (Tok && !Tok->is(TT_FunctionLBrace)) { + if (Tok->is(tok::kw_static)) + HasStatic = true; + if (Tok->is(tok::kw_inline)) + HasInline = true; + Tok = Tok->Next; + } + + // If we found both static and inline, allow merging ---------------- irymarchyk wrote:
Thanks, fixed https://github.com/llvm/llvm-project/pull/133598 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits