================
@@ -4897,8 +4897,15 @@ ExpectedDecl ASTNodeImporter::VisitVarDecl(VarDecl *D) {
   if (Error Err = ImportInitializer(D, ToVar))
     return std::move(Err);
 
-  if (D->isConstexpr())
+  if (D->isConstexpr()) {
     ToVar->setConstexpr(true);
+    // Tell the bytecode interpreter that a new constexpr variable has 
appeared.
+    if (ToVar->getASTContext().getLangOpts().EnableNewConstInterp) {
+      if (const Expr *Init = ToVar->getInit();
+          Init && !Init->isValueDependent())
+        ToVar->evaluateValue();
+    }
+  }
----------------
ojhunt wrote:

Trying to understand this - where does the ~~soon to be deprecated~~ current 
interpreter handle this case?

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

Reply via email to