summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format
diff options
context:
space:
mode:
authorAndrew Ng <anng.sw@gmail.com>2019-02-26 14:34:49 +0000
committerAndrew Ng <anng.sw@gmail.com>2019-02-26 14:34:49 +0000
commit301f304949ad3e5cd3e56f1999f1c4abae6d6ead (patch)
tree46fa9c39b54de951d40fea837d8f6060d09a5171 /clang/unittests/Format
parent60ec08f0678f172b3bd08b4a7a82eccb3a950cfe (diff)
downloadbcm5719-llvm-301f304949ad3e5cd3e56f1999f1c4abae6d6ead.tar.gz
bcm5719-llvm-301f304949ad3e5cd3e56f1999f1c4abae6d6ead.zip
[clang-format] SpaceBeforeParens for lambda expressions
Add support for lambda expressions to the SpaceBeforeParens formatting option. Differential Revision: https://reviews.llvm.org/D58241 llvm-svn: 354880
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r--clang/unittests/Format/FormatTest.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index eea18440d08..064ece13cee 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -9238,6 +9238,7 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) {
verifyFormat("typedef void (*cb)(int);", NoSpace);
verifyFormat("T A::operator()();", NoSpace);
verifyFormat("X A::operator++(T);", NoSpace);
+ verifyFormat("auto lambda = []() { return 0; };", NoSpace);
FormatStyle Space = getLLVMStyle();
Space.SpaceBeforeParens = FormatStyle::SBPO_Always;
@@ -9285,6 +9286,7 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) {
verifyFormat("typedef void (*cb) (int);", Space);
verifyFormat("T A::operator() ();", Space);
verifyFormat("X A::operator++ (T);", Space);
+ verifyFormat("auto lambda = [] () { return 0; };", Space);
}
TEST_F(FormatTest, ConfigurableSpacesInParentheses) {
OpenPOWER on IntegriCloud