================ @@ -26827,6 +26827,31 @@ TEST_F(FormatTest, BreakAdjacentStringLiterals) { Style.BreakAdjacentStringLiterals = false; verifyFormat(Code, Style); } + +TEST_F(FormatTest, BreakAfterGNUAttributes) { + FormatStyle Style = getLLVMStyle(); + Style.BreakAfterAttributes = FormatStyle::ABS_Never; + + verifyFormat("__attribute__((__warn_unused_result__)) const int i;", Style); + + verifyFormat( + "__attribute__((other)) __attribute__((__warn_unused_result__)) int j;", + Style); + + verifyFormat("__attribute__((__warn_unused_result__)) inline int f(int &i);", + Style); + + Style.BreakAfterAttributes = FormatStyle::ABS_Always; + verifyFormat("__attribute__((__warn_unused_result__))\nconst int i;", Style); ---------------- hnakamura5 wrote:
How about breaking the string and the line after '\n' ? ```suggestion verifyFormat("__attribute__((__warn_unused_result__))\n" "const int i;", Style); ``` ↑ Test cases around look like that. https://github.com/llvm/llvm-project/pull/78102 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits