[PATCH] D83855: [clang] Fix printing of lambdas with capture expressions

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 16 03:20:43 PDT 2020


kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

thanks, lgtm!



================
Comment at: clang/lib/AST/StmtPrinter.cpp:2014
+      if (D->getInitStyle() == VarDecl::CallInit) {
+        if (!isa<ParenListExpr>(D->getInit())) {
+          Pre = "(";
----------------
ah, now i see the use for it, thanks for the testcase !

could you please `and` with the previous condition rather than extra nesting.


================
Comment at: clang/lib/AST/StmtPrinter.cpp:2018
+        }
+      } else if (D->getInitStyle() == VarDecl::CInit)
+        Pre = " = ";
----------------
nit: braces


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83855





More information about the cfe-commits mailing list