summaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index dc20faf70c..0f5040488e 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -14074,6 +14074,15 @@ TEST_F(FormatTest, TypenameMacros) {
verifyFormat("STACK_OF(int*)* a;", Macros);
}
+TEST_F(FormatTest, AmbersandInLamda) {
+ // Test case reported in https://bugs.llvm.org/show_bug.cgi?id=41899
+ FormatStyle AlignStyle = getLLVMStyle();
+ AlignStyle.PointerAlignment = FormatStyle::PAS_Left;
+ verifyFormat("auto lambda = [&a = a]() { a = 2; };", AlignStyle);
+ AlignStyle.PointerAlignment = FormatStyle::PAS_Right;
+ verifyFormat("auto lambda = [&a = a]() { a = 2; };", AlignStyle);
+}
+
} // end namespace
} // end namespace format
} // end namespace clang