[PATCH] D76696: [AST] Build recovery expressions by default for C++.
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 26 14:09:01 PDT 2020
sammccall added a comment.
In D76696#1944825 <https://reviews.llvm.org/D76696#1944825>, @hubert.reinterpretcast wrote:
> In D76696#1944784 <https://reviews.llvm.org/D76696#1944784>, @sammccall wrote:
>
> > The general scheme is probably common: unresolved expr -> ??? -> an expression is dependent but not marked as such -> constant evaluation crashes.
> >
> > But the ??? matters, as that's where the fix is.
> > In the case above: expr is used in a member of X, and X is not a dependent type, so sizeof(X) is not considered dependent
>
>
> The context, if I understand correctly for the cases I am seeing, boil down to:
>
> - Value of a member initializer for a constexpr constructor
struct X {
int Y;
constexpr X() : Y(foo()) {]
};
This will need a different fix I think. Maybe just isPotentialConstantExpr needs to bail out if there are errors.
> - Bitfield width
struct X { int Y : foo(); };
constexpr int Z = sizeof(X);
I think this one is just another case of marking the fielddecl as invalid.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76696/new/
https://reviews.llvm.org/D76696
More information about the cfe-commits
mailing list