[all-commits] [llvm/llvm-project] d1a59e: [Clang] Remove redundant init-parens in AST print

zhihaoy via All-commits all-commits at lists.llvm.org
Mon Feb 28 17:31:50 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d1a59eefd3a09f08ba425a20899fbd1766babc45
      https://github.com/llvm/llvm-project/commit/d1a59eefd3a09f08ba425a20899fbd1766babc45
  Author: Zhihao Yuan <zhihao.yuan at broadcom.com>
  Date:   2022-02-28 (Mon, 28 Feb 2022)

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

  Log Message:
  -----------
  [Clang] Remove redundant init-parens in AST print

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

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D120608




More information about the All-commits mailing list