From f090f031bc367b73217c82ab7607ef1a129c574d Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 18 May 2015 09:47:22 +0000 Subject: clang-format: Support function annotations in macros. Before: DEPRECATED("Use NewClass::NewFunction instead.") string OldFunction(const string ¶meter) {} After: DEPRECATED("Use NewClass::NewFunction instead.") string OldFunction(const string ¶meter) {} llvm-svn: 237562 --- clang/unittests/Format/FormatTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/unittests/Format/FormatTest.cpp') diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index f7510c86189..5e69e05d4a4 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -4040,6 +4040,14 @@ TEST_F(FormatTest, BreaksFunctionDeclarationsWithTrailingTokens) { " aaaaaaaaaaaaaaaaaaaaaaaaa;"); } +TEST_F(FormatTest, FunctionAnnotations) { + verifyFormat("DEPRECATED(\"Use NewClass::NewFunction instead.\")\n" + "string OldFunction(const string ¶meter) {}"); + verifyFormat("template \n" + "DEPRECATED(\"Use NewClass::NewFunction instead.\")\n" + "string OldFunction(const string ¶meter) {}"); +} + TEST_F(FormatTest, BreaksDesireably) { verifyFormat("if (aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa) ||\n" " aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa) ||\n" -- cgit v1.2.3