summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 32e70700fa3..910df459761 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -7890,6 +7890,10 @@ TEST_F(FormatTest, FormatsLambdas) {
" [&](int, int) { return 1; });\n"
"}\n");
+ // Lambdas with return types.
+ verifyFormat("int c = []()->int { return 2; }();\n");
+ verifyFormat("int c = []()->vector<int> { return { 2 }; }();\n");
+
// Not lambdas.
verifyFormat("constexpr char hello[]{ \"hello\" };");
verifyFormat("double &operator[](int i) { return 0; }\n"
OpenPOWER on IntegriCloud