Allow us to better guess the context of an unwrapped line.
This gives us the ability to guess better defaults for whether a *
between identifiers is a pointer dereference or binary operator.
Now correctly formats:
void f(a *b);
void f() { f(a * b); }
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173243 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 3065a83..7daf7aa 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1666,6 +1666,11 @@
"/* */someCall(parameter);", getLLVMStyleWithColumns(15)));
}
+TEST_F(FormatTest, Fuck) {
+ verifyFormat("void f(int *a);");
+ verifyFormat("void f() { f(fint * b); }");
+}
+
//===----------------------------------------------------------------------===//
// Objective-C tests.
//===----------------------------------------------------------------------===//