[PATCH] D120608: [Clang] Remove redundant init-parens in AST print

Zhihao Yuan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 25 20:56:01 PST 2022


lichray created this revision.
lichray requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Given a dependent `T` (maybe an undeduced `auto`),

Before:

  new T(z)  -->  new T((z))  # changes meaning with more args
  new T{z}  -->  new T{z}
      T(z)  -->      T(z)
      T{z}  -->      T({z})  # forbidden if T is auto

After:

  new T(z)  -->  new T(z)
  new T{z}  -->  new T{z}
      T(z)   -->     T(z)
      T{z}   -->     T{z}

Depends on D113393 <https://reviews.llvm.org/D113393>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120608

Files:
  clang/lib/AST/StmtPrinter.cpp
  clang/test/CXX/expr/expr.prim/expr.prim.req/simple-requirement.cpp
  clang/test/SemaCXX/cxx2b-ast-print.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120608.411572.patch
Type: text/x-patch
Size: 3811 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220226/bf46f8d5/attachment.bin>


More information about the cfe-commits mailing list