[libc-commits] [clang-tools-extra] [libc] [flang] [llvm] [libcxx] [clang] [compiler-rt] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

via libc-commits libc-commits at lists.llvm.org
Thu Jan 18 12:12:29 PST 2024


cor3ntin wrote:

`CheckConstexprFunctionDefinition` will return false for a destructor if `defaultedDestructorIsConstexpr` returns false (unless we want to emit a diagnostic)`

as @groundswellaudio pointed out in https://github.com/llvm/llvm-project/pull/78195, this is because 
https://github.com/llvm/llvm-project/blob/99cae9a44fca4cfbd6ee82f196051cbdf6571fa1/clang/lib/AST/DeclCXX.cpp#L551

will set `DefaultedDestructorIsConstexpr` regardless of language mode, which it should not.
(and `CheckConstexprFunctionDefinition` should not look at `defaultedDestructorIsConstexpr`in c++23 mode because of 
that change https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2448r2.html#pnum_38

We should also inspect uses and setting of `DefaultedDefaultConstructorIsConstexpr`

https://github.com/llvm/llvm-project/pull/77753


More information about the libc-commits mailing list