[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
Fri Aug 5 05:14:37 PDT 2022
aaron.ballman added a comment.
In D131194#3700688 <https://reviews.llvm.org/D131194#3700688>, @efriedma wrote:
> Instead of trying to dig through subexpressions of the ConstantExpr to try to infer the type we need, can we just compute it directly?
> QualType RetType = CE->getType();
> if (CE->isGLValue())
> RetType = CGM.getContext().getLValueReferenceType(RetType);
Oh wow, that's a *much* better approach, thank you for the suggestion! It passed my local testing, so hopefully precommit CI doesn't spot any concerns from it.
CHANGES SINCE LAST ACTION
More information about the cfe-commits