[PATCH] D120589: [Clang] Implement decltype(auto)(x) from P0849R2

Zhihao Yuan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 25 12:51:12 PST 2022


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

As a Clang extension. See also https://wg21.link/p0849r2

The implementation takes a shortcut by forming CXXFunctionalCastExpr.
Doing so costs losing 'decltype(auto)' keyword in AST. Although
we do that elsewhere, because this is in an expression, it's more
difficult to keep AST print legal *and* trustworthy.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120589

Files:
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Sema/SemaExprCXX.cpp
  clang/lib/Sema/SemaType.cpp
  clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.auto.deduct/p2.cpp
  clang/test/CXX/expr/expr.post/expr.type.conv/p1-2b.cpp
  clang/test/SemaCXX/deduced-return-type-cxx14.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120589.411504.patch
Type: text/x-patch
Size: 11657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220225/b5da061d/attachment.bin>


More information about the cfe-commits mailing list