[clang] Fix crash with modules and constexpr destructor (PR #69076)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 19:38:44 PDT 2023


================
@@ -15604,10 +15604,13 @@ bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx,
     LValue LVal;
     LVal.set(VD);
 
-    if (!EvaluateInPlace(Value, Info, LVal, this,
-                         /*AllowNonLiteralTypes=*/true) ||
-        EStatus.HasSideEffects)
-      return false;
+    {
+      FullExpressionRAII Scope(Info);
----------------
shafik wrote:

I think we need to add a comment here similar to the one in `EvaluateAsConstexpr(...)` in this case it would be `A full-expression is ... an init-declarator ([dcl.decl]) or a mem-initializer` see https://eel.is/c++draft/intro.execution#5.4

CC @cor3ntin for second look

https://github.com/llvm/llvm-project/pull/69076


More information about the cfe-commits mailing list