summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 05119f37cb1..ecdb7216ba6 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -3335,6 +3335,10 @@ TEST_F(FormatTest, UnderstandsPointersToMembers) {
" ((*a).*f)();\n"
" a.*x;\n"
"}");
+ verifyFormat("void f() {\n"
+ " (a->*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(\n"
+ " aaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);\n"
+ "}");
FormatStyle Style = getLLVMStyle();
Style.PointerBindsToType = true;
verifyFormat("typedef bool* (Class::*Member)() const;", Style);
@@ -3633,6 +3637,11 @@ TEST_F(FormatTest, FormatsCasts) {
verifyFormat("my_int a = (my_int)++ a;");
verifyFormat("my_int a = (my_int) + 2;");
+ // Don't break after a cast's
+ verifyFormat("int aaaaaaaaaaaaaaaaaaaaaaaaaaa =\n"
+ " (aaaaaaaaaaaaaaaaaaaaaaaaaa *)(aaaaaaaaaaaaaaaaaaaaaa +\n"
+ " bbbbbbbbbbbbbbbbbbbbbb);");
+
// These are not casts.
verifyFormat("void f(int *) {}");
verifyFormat("f(foo)->b;");
OpenPOWER on IntegriCloud