[all-commits] [llvm/llvm-project] bf1e23: Implement CWG2631
cor3ntin via All-commits
all-commits at lists.llvm.org
Thu Nov 3 23:59:11 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: bf1e235695a7acdc3e868217e69d5b31ada06cb3
https://github.com/llvm/llvm-project/commit/bf1e235695a7acdc3e868217e69d5b31ada06cb3
Author: Corentin Jabot <corentinjabot at gmail.com>
Date: 2022-11-04 (Fri, 04 Nov 2022)
Changed paths:
M clang/docs/ReleaseNotes.rst
M clang/include/clang/AST/ExprCXX.h
M clang/include/clang/AST/Stmt.h
M clang/include/clang/Basic/DiagnosticSemaKinds.td
M clang/include/clang/Sema/Sema.h
M clang/lib/AST/ASTImporter.cpp
M clang/lib/AST/ExprCXX.cpp
M clang/lib/Parse/ParseCXXInlineMethods.cpp
M clang/lib/Parse/ParseDeclCXX.cpp
M clang/lib/Sema/SemaDeclCXX.cpp
M clang/lib/Sema/SemaExpr.cpp
M clang/lib/Sema/SemaTemplateInstantiate.cpp
M clang/lib/Sema/TreeTransform.h
M clang/lib/Serialization/ASTReaderStmt.cpp
M clang/lib/Serialization/ASTWriterStmt.cpp
M clang/test/CXX/class/class.local/p1-0x.cpp
A clang/test/CodeGenCXX/default-arguments-with-immediate.cpp
A clang/test/PCH/default-argument-with-immediate-calls.cpp
A clang/test/SemaCXX/cxx2a-consteval-default-params.cpp
M clang/test/SemaCXX/source_location.cpp
Log Message:
-----------
Implement CWG2631
Implement https://cplusplus.github.io/CWG/issues/2631.html.
Immediate calls in default arguments and defaults members
are not evaluated.
Instead, we evaluate them when constructing a
`CXXDefaultArgExpr`/`BuildCXXDefaultInitExpr`.
The immediate calls are executed by doing a
transform on the initializing expression.
Note that lambdas are not considering subexpressions so
we do not need to transform them.
As a result of this patch, unused default member
initializers are not considered odr-used, and
errors about members binding to local variables
in an outer scope only surface at the point
where a constructor is defined.
Reviewed By: aaron.ballman, #clang-language-wg
Differential Revision: https://reviews.llvm.org/D136554
More information about the All-commits
mailing list