[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 14 02:11:46 PDT 2024


Fznamznon wrote:

> I looked at this a bit and the change that increases the constexpr restrictions is that ext_defaulted_comparison_constexpr_mismatch (which was added in https://reviews.llvm.org/D146090) became err_incorrect_defaulted_comparison_constexpr?

Yes, it was intentional change. And the diagnostic you're seeing is valid for C++20. Prior C++23 defaulted function that invokes non-constexpr function under the hood cannot be marked constexpr. Since relaxing that was made in https://reviews.llvm.org/D146090 is a part of P2448R2, but other parts implemented by this patch are C++23-only due to the problems I described in https://github.com/llvm/llvm-project/pull/77753#issuecomment-1979028701 , I've made all parts of P2448R2 consistent.
I would suggest opening an issue here on GitHub to discuss whether we would like to make the feature inconsistent.

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


More information about the cfe-commits mailing list