clang-format: Detect weird macro lambda usage.
Before:
void f() {
MACRO((const AA & a) { return 1; });
}
After:
void f() {
MACRO((const AA &a) { return 1; });
}
llvm-svn: 203551
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 6e8e955..d3ad9fb 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -7986,6 +7986,11 @@
" bar([]() {} // Did not respect SpacesBeforeTrailingComments\n"
" );\n"
"}");
+
+ // Lambdas created through weird macros.
+ verifyFormat("void f() {\n"
+ " MACRO((const AA &a) { return 1; });\n"
+ "}");
}
TEST_F(FormatTest, FormatsBlocks) {