[PATCH] D155175: [Clang] Fix consteval propagation for aggregates and defaulted constructors
Corentin Jabot via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 13 04:05:34 PDT 2023
cor3ntin created this revision.
Herald added a project: All.
cor3ntin requested review of this revision.
Herald added subscribers: cfe-commits, wangpc.
Herald added a project: clang.
This patch does a few things:
- Fix aggregate initialization. When an aggregate has an initializer that is immediate-escalating, the context in which it is used automatically becomes an immediate function. The wording does that by rpretending an aggregate initialization is itself an invocation which is not really how clang works, so my previous attempt was... wrong.
- Fix initialization of defaulted constructors with immediate escalating default member initializers. The wording was silent about that case and I did not handled it fully https://cplusplus.github.io/CWG/issues/2760.html
- Fix diagnostics In some cases clang would produce additional and unhelpful diagnostics by listing the invalid references to consteval function that appear in immediate escalating functions
Fixes https://github.com/llvm/llvm-project/issues/63742
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D155175
Files:
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/SemaCXX/cxx2a-consteval-default-params.cpp
clang/test/SemaCXX/cxx2b-consteval-propagate.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155175.539945.patch
Type: text/x-patch
Size: 9120 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230713/bb36ef7d/attachment-0001.bin>
More information about the cfe-commits
mailing list