clang-format: Fix bad variable declaration detection.
Before:
LooooooooooooooooongType
variable(nullptr, [](A *a) {});
After:
LooooooooooooooooongType
variable(nullptr, [](A *a) {});
llvm-svn: 294358
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 8f531af..4712472 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -6934,6 +6934,11 @@
" LoooooooooooooooooooooooooooooooooooooooongVariable({});");
verifyFormat("LoooooooooooooooooooooooooooooooooooooooongType\n"
" LoooooooooooooooooooooooooooooooooooooongVariable([A a]);");
+
+ // Lambdas should not confuse the variable declaration heuristic.
+ verifyFormat("LooooooooooooooooongType\n"
+ " variable(nullptr, [](A *a) {});",
+ getLLVMStyleWithColumns(40));
}
TEST_F(FormatTest, BreaksLongDeclarations) {