[all-commits] [llvm/llvm-project] daa6d7: [Clang] Use of decltype(capture) in parameter-decl...

cor3ntin via All-commits all-commits at lists.llvm.org
Mon Apr 18 06:58:39 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: daa6d7b250edb81ffef7770a71049d7af211698b
      https://github.com/llvm/llvm-project/commit/daa6d7b250edb81ffef7770a71049d7af211698b
  Author: Corentin Jabot <corentinjabot at gmail.com>
  Date:   2022-04-18 (Mon, 18 Apr 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Parse/Parser.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Parse/ParseDeclCXX.cpp
    M clang/lib/Parse/ParseExprCXX.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/SemaCXX/lambda-capture-type-deduction.cpp

  Log Message:
  -----------
  [Clang] Use of decltype(capture) in parameter-declaration-clause

Partially implement the proposed resolution to CWG2569.

D119136 broke some libstdc++ code, as P2036R3, implemented as a DR to
C++11 made ill-formed some previously valid and innocuous code.

We resolve this issue to allow decltype(x) - but not decltype((x)
to appear in the parameter list of a lambda that capture x by copy.

Unlike CWG2569, we do not extend that special treatment to
sizeof/noexcept yet, as the resolution has not been approved yet
and keeping the review small allows a quicker fix of impacted code.

Reviewed By: aaron.ballman

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




More information about the All-commits mailing list