================
@@ -3212,8 +3212,17 @@ static bool HandleLValueMember(EvalInfo &Info, const
Expr *E, LValue &LVal,
const FieldDecl *FD,
const ASTRecordLayout *RL = nullptr) {
if (!RL) {
- if (FD->getParent()->isInvalidDecl()) return false;
- RL = &Info.Ctx.getASTRecordLayout(FD->getParent());
+ const RecordDecl *RD = FD->getParent();
+ if (RD->isInvalidDecl())
+ return false;
+ // There are some cases where the base is not yet complete but we haven't
+ // disagnosed (such as in a template instantation of an attribute that
+ // references the expression, ala enable_if). These aren't necessarily
+ // constant expressions so we return 'false', but they might be, so we
don't
+ // diagnose.
+ if (!RD->isCompleteDefinition())
+ return false;
----------------
cor3ntin wrote:
Can you add a RUN line? (If something else breaks in the file, put the new test
in a new file)
https://github.com/llvm/llvm-project/pull/209537
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits