diff options
author | Manuel Klimek <klimek@google.com> | 2013-01-23 09:32:48 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-01-23 09:32:48 +0000 |
commit | 70b03f4edaefcc5b9aa2e084d1c12e9d91b32a77 (patch) | |
tree | e43b61232306a4d0ea1fee82dc51eab210a1710e /unittests/Format/FormatTest.cpp | |
parent | 69652660e765ec2bbcf1877ac05c66e91b8fa745 (diff) |
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
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 3065a836dd..7daf7aac6c 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1666,6 +1666,11 @@ TEST_F(FormatTest, BlockComments) { "/* */someCall(parameter);", getLLVMStyleWithColumns(15))); } +TEST_F(FormatTest, Fuck) { + verifyFormat("void f(int *a);"); + verifyFormat("void f() { f(fint * b); }"); +} + //===----------------------------------------------------------------------===// // Objective-C tests. //===----------------------------------------------------------------------===// |