From 47bbda093917d7e16f59df20ae409c07b4624e30 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 18 May 2015 13:47:23 +0000 Subject: 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 --- clang/unittests/Format/FormatTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/unittests/Format/FormatTest.cpp') 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 \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) { -- cgit v1.2.3