diff options
author | Daniel Jasper <djasper@google.com> | 2015-05-18 13:47:23 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-05-18 13:47:23 +0000 |
commit | 47bbda093917d7e16f59df20ae409c07b4624e30 (patch) | |
tree | 79868eb7303cc1df9f8aa5b71aff53dfda86d4da /clang/unittests/Format/FormatTest.cpp | |
parent | 055ad9beba8db1c124c329a8359ab16b903d754a (diff) | |
download | bcm5719-llvm-47bbda093917d7e16f59df20ae409c07b4624e30.tar.gz bcm5719-llvm-47bbda093917d7e16f59df20ae409c07b4624e30.zip |
clang-format: Improve detection of macros annotating functions.
Before:
ASSERT("aaaaaaaaaaaaaaa")
<< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
<< bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
After:
ASSERT("aaaaaaaaaaaaaaa") << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
<< bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
Also cleanup implementation a bit and only mark closing parenthesis of
these annotations.
llvm-svn: 237567
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index f41928fe725..00c23b5bcc1 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -4046,6 +4046,10 @@ TEST_F(FormatTest, FunctionAnnotations) { verifyFormat("template <typename T>\n" "DEPRECATED(\"Use NewClass::NewFunction instead.\")\n" "string OldFunction(const string ¶meter) {}"); + + // Not function annotations. + verifyFormat("ASSERT(\"aaaaa\") << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" + " << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); } TEST_F(FormatTest, BreaksDesireably) { |