[PATCH] D155064: [clang][SemaCXX] Diagnose tautological uses of consteval if and is_constant_evaluated

Takuya Shimizu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 28 00:45:56 PDT 2023


hazohelet added a comment.

Thank you for the revert!

This looks like a general issue of clang on template deduction in constant-evaluated context (https://godbolt.org/z/zTro7Ycfa). Pushing constant-evaluated context against initializer of instantiated constexpr variables made this bug appear in broader scenarios.
I can circumvent this problem by not pushing constant-evaluated context on instantiated constexpr variable initializers, but that in turn would force me to do tricky workaround in warnings on narrowing conversions in global constexpr variable templates.

@cor3ntin
The constant-evaluated-context miscompilation bisected to https://reviews.llvm.org/D140554
Is this the intended result of that patch?
I'm at lost how to proceed further on this patch. The only way looks like some workarounds in narrowing conversion warning mechanism, but is it acceptable?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155064/new/

https://reviews.llvm.org/D155064



More information about the cfe-commits mailing list