From d6a1cab1bcf509645b5119d92e95bbd7ab5131a3 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 12 Jan 2015 10:23:24 +0000 Subject: clang-format: Improve format of lambdas in ctor initializers. Before: Constructor() : Constructor([] { // comment int i; }) {} After: Constructor() : Constructor([] { // comment int i; }) {} llvm-svn: 225625 --- clang/unittests/Format/FormatTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/unittests') diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index a49a35c1def..3bb55402e71 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -9380,6 +9380,10 @@ TEST_F(FormatTest, FormatsLambdas) { verifyFormat("string abc = SomeFunction(aaaaaaaaaaaaa, aaaaa, []() {\n" " SomeOtherFunctioooooooooooooooooooooooooon();\n" "});"); + verifyFormat("Constructor()\n" + " : Field([] { // comment\n" + " int i;\n" + " }) {}"); // Lambdas with return types. verifyFormat("int c = []() -> int { return 2; }();\n"); -- cgit v1.2.3