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.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index a154af931d9..b2c5307341d 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -5161,6 +5161,8 @@ TEST_F(FormatTest, UnderstandsTemplateParameters) {
EXPECT_EQ("A<A<A<A>>> a;", format("A<A<A<A>> > a;", getGoogleStyle()));
EXPECT_EQ("A<::A<int>> a;", format("A< ::A<int>> a;", getGoogleStyle()));
EXPECT_EQ("A<::A<int>> a;", format("A<::A<int> > a;", getGoogleStyle()));
+ EXPECT_EQ("auto x = [] { A<A<A<A>>> a; };",
+ format("auto x=[]{A<A<A<A> >> a;};", getGoogleStyle()));
verifyFormat("A<A>> a;", getChromiumStyle(FormatStyle::LK_Cpp));
@@ -5622,6 +5624,15 @@ TEST_F(FormatTest, AdaptivelyFormatsPointersAndReferences) {
"int * a;\n"
"int * a;",
getGoogleStyle()));
+ EXPECT_EQ("auto x = [] {\n"
+ " int *a;\n"
+ " int *a;\n"
+ " int *a;\n"
+ "};",
+ format("auto x=[]{int *a;\n"
+ "int * a;\n"
+ "int * a;};",
+ getGoogleStyle()));
}
TEST_F(FormatTest, UnderstandsRvalueReferences) {
OpenPOWER on IntegriCloud