[PATCH] D56909: [clang-format] Fix line parsing for noexcept lambdas

Ben Hamilton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 30 05:54:46 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL352622: [clang-format] Fix line parsing for noexcept lambdas (authored by benhamilton, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D56909?vs=182514&id=184281#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56909/new/

https://reviews.llvm.org/D56909

Files:
  cfe/trunk/lib/Format/UnwrappedLineParser.cpp
  cfe/trunk/unittests/Format/FormatTest.cpp


Index: cfe/trunk/lib/Format/UnwrappedLineParser.cpp
===================================================================
--- cfe/trunk/lib/Format/UnwrappedLineParser.cpp
+++ cfe/trunk/lib/Format/UnwrappedLineParser.cpp
@@ -1422,6 +1422,7 @@
     case tok::numeric_constant:
     case tok::coloncolon:
     case tok::kw_mutable:
+    case tok::kw_noexcept:
       nextToken();
       break;
     case tok::arrow:
Index: cfe/trunk/unittests/Format/FormatTest.cpp
===================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp
+++ cfe/trunk/unittests/Format/FormatTest.cpp
@@ -11725,6 +11725,8 @@
 
 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");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56909.184281.patch
Type: text/x-patch
Size: 1089 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190130/622f3c38/attachment.bin>


More information about the cfe-commits mailing list