[PATCH] D131194: [C++20] Fix crash-on-valid with consteval temporary construction through list initialization
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 4 12:32:36 PDT 2022
aaron.ballman added inline comments.
================
Comment at: clang/lib/CodeGen/CGExprConstant.cpp:1404
+ // default value here and reset the type only as needed.
+ QualType RetType = Inner->getType();
if (auto *Call = dyn_cast<CallExpr>(Inner))
----------------
erichkeane wrote:
> Is there any possibility to have an assert somewhere to catch when this ISN'T the type we need to see later? It would be nice to figure out what other cases we're missing below.
Not that I've found yet, but if someone has ideas, I'm definitely open to them because I worry about that as well. I had originally tried just asserting that the value was valid, but a *bunch* of code calls this where the `RetType` doesn't matter and was tripping up that assertion.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131194/new/
https://reviews.llvm.org/D131194
More information about the cfe-commits
mailing list