diff options
author | Daniel Jasper <djasper@google.com> | 2015-05-18 09:47:22 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-05-18 09:47:22 +0000 |
commit | f090f031bc367b73217c82ab7607ef1a129c574d (patch) | |
tree | 4a32650dc07676384b300aabb4897200dd8196d6 /clang/unittests/Format/FormatTest.cpp | |
parent | 8fc69dcf42417866b960ae6dbdb284fb8e70c393 (diff) | |
download | bcm5719-llvm-f090f031bc367b73217c82ab7607ef1a129c574d.tar.gz bcm5719-llvm-f090f031bc367b73217c82ab7607ef1a129c574d.zip |
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
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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 <typename T>\n" + "DEPRECATED(\"Use NewClass::NewFunction instead.\")\n" + "string OldFunction(const string ¶meter) {}"); +} + TEST_F(FormatTest, BreaksDesireably) { verifyFormat("if (aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa) ||\n" " aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa) ||\n" |