summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorBen Hamilton <benhamilton@google.com>2019-01-30 13:54:32 +0000
committerBen Hamilton <benhamilton@google.com>2019-01-30 13:54:32 +0000
commit4e442bb875132bef9f07290ae6d25810dc7c1107 (patch)
tree03147cdb8c5fd9a463af43c00f215f487f680881 /clang/unittests/Format/FormatTest.cpp
parent365021cc1562b973159bda7ffc923c373c310ec2 (diff)
downloadbcm5719-llvm-4e442bb875132bef9f07290ae6d25810dc7c1107.tar.gz
bcm5719-llvm-4e442bb875132bef9f07290ae6d25810dc7c1107.zip
[clang-format] Fix line parsing for noexcept lambdas
Summary: > $ echo "int c = [b]() mutable noexcept { return [&b] { return b++; }(); }();" |clang-format ``` int c = [b]() mutable noexcept { return [&b] { return b++; }(); } (); ``` with patch: > $ echo "int c = [b]() mutable noexcept { return [&b] { return b++; }(); }();" |bin/clang-format ``` int c = [b]() mutable noexcept { return [&b] { return b++; }(); }(); ``` Contributed by hultman. Reviewers: benhamilton, jolesiak, klimek, Wizard Reviewed By: benhamilton Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56909 llvm-svn: 352622
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-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 0f7e0cd5b28..99b2beadc4a 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -11725,6 +11725,8 @@ TEST_F(FormatTest, FormatsWithWebKitStyle) {
TEST_F(FormatTest, FormatsLambdas) {
verifyFormat("int c = [b]() mutable { return [&b] { return b++; }(); }();\n");
+ verifyFormat(
+ "int c = [b]() mutable noexcept { return [&b] { return b++; }(); }();\n");
verifyFormat("int c = [&] { [=] { return b++; }(); }();\n");
verifyFormat("int c = [&, &a, a] { [=, c, &d] { return b++; }(); }();\n");
verifyFormat("int c = [&a, &a, a] { [=, a, b, &c] { return b++; }(); }();\n");
OpenPOWER on IntegriCloud