clang-format: Fix trailing const (etc.) with Allman brace style.
Before:
void someLongFunction(int someLongParameter)
const
{
}
After:
void someLongFunction(
int someLongParameter) const
{
}
This fixes llvm.org/PR19912.
llvm-svn: 210010
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 8aa2560..9a91b9e 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -3469,6 +3469,13 @@
" int parameter) const override {}",
Style);
+ Style.BreakBeforeBraces = FormatStyle::BS_Allman;
+ verifyFormat("void someLongFunction(\n"
+ " int someLongParameter) const\n"
+ "{\n"
+ "}",
+ Style);
+
// Unless these are unknown annotations.
verifyFormat("void SomeFunction(aaaaaaaaaa aaaaaaaaaaaaaaa,\n"
" aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n"