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 | e3f907fdedc365fdd4dd2382db5873aa73601c1f (patch) | |
| tree | acafb6e2841457aae953d056ea962975df0760cf /clang/unittests/Format/FormatTest.cpp | |
| parent | 2fcc4277416186e2f46340c9ee29859bceb77623 (diff) | |
| download | bcm5719-llvm-e3f907fdedc365fdd4dd2382db5873aa73601c1f.tar.gz bcm5719-llvm-e3f907fdedc365fdd4dd2382db5873aa73601c1f.zip | |
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
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 8aa256053fb..9a91b9ef047 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/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" |

