[all-commits] [llvm/llvm-project] ca6196: Implement CWG2631
cor3ntin via All-commits
all-commits at lists.llvm.org
Sun Jan 8 01:35:41 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ca619613801233ef2def8c3cc7d311d5ed0033cb
https://github.com/llvm/llvm-project/commit/ca619613801233ef2def8c3cc7d311d5ed0033cb
Author: Corentin Jabot <corentinjabot at gmail.com>
Date: 2023-01-08 (Sun, 08 Jan 2023)
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/Decl.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/Sema/UsedDeclVisitor.h
M clang/lib/Serialization/ASTReaderStmt.cpp
M clang/lib/Serialization/ASTWriterStmt.cpp
M clang/test/AST/ast-dump-records.cpp
M clang/test/CXX/class/class.local/p1-0x.cpp
M clang/test/CXX/drs/dr26xx.cpp
M clang/test/CodeGenCXX/builtin-source-location.cpp
A clang/test/CodeGenCXX/default-arguments-with-immediate.cpp
A clang/test/CodeGenCXX/meminit-initializers-odr.cpp
A clang/test/PCH/default-argument-with-immediate-calls.cpp
M clang/test/SemaCXX/cxx11-default-member-initializers.cpp
A clang/test/SemaCXX/cxx2a-consteval-default-params.cpp
M clang/test/SemaCXX/source_location.cpp
M clang/www/cxx_dr_status.html
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, rupprecht
Differential Revision: https://reviews.llvm.org/D136554
More information about the All-commits
mailing list