diff options
author | Daniel Jasper <djasper@google.com> | 2014-06-02 09:52:08 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-06-02 09:52:08 +0000 |
commit | 5c7f7663b274c73a85f26d82f71085dde4d06195 (patch) | |
tree | 70cc9d54c24ff7122714960a4555709ea321a29c /unittests/Format | |
parent | 7769111c63bf3d0df3c25d36c5c470787627edfe (diff) | |
download | clang-5c7f7663b274c73a85f26d82f71085dde4d06195.tar.gz clang-5c7f7663b274c73a85f26d82f71085dde4d06195.tar.bz2 clang-5c7f7663b274c73a85f26d82f71085dde4d06195.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210010 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 8aa256053f..9a91b9ef04 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -3469,6 +3469,13 @@ TEST_F(FormatTest, BreaksFunctionDeclarationsWithTrailingTokens) { " 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" |