================
@@ -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;
----------------
erichkeane wrote:

@tbaederr for visibility.

I tried my test with `-fexperimental-new-constant-interpreter` and it doesn't 
reproduce, so I think that means no? 

https://github.com/llvm/llvm-project/pull/209537
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to