[PATCH] D105127: Implement P1401R5
Corentin Jabot via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 30 15:07:26 PDT 2021
cor3ntin marked 2 inline comments as done.
cor3ntin added inline comments.
================
Comment at: clang/lib/Sema/SemaExprCXX.cpp:3929
+
+ if (IsConstexpr && !LangOpts.CPlusPlus2b && !CondExpr->isValueDependent()) {
+ llvm::APSInt Value(/*BitWidth*/ 1);
----------------
rsmith wrote:
> I think we should apply this retroactively, even though it wasn't moved as a DR. All other implementations already behave this way across all language modes, and it's just not reasonable to reject conversions in the condition of an `if constexpr` that are accepted in the condition of an `if` -- this seems like an obvious language defect even if the C++ committee haven't officially voted it to be one yet.
>
> Separately I've asked on the committee reflectors if we can officially treat this as a DR, given the implementation consensus.
I'll do that - it might take me a few days to get to it though
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105127/new/
https://reviews.llvm.org/D105127
More information about the cfe-commits
mailing list