[clang] [clang] Use new interpreter in EvaluateAsConstantExpr if requested (PR #70763)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 14 06:32:58 PST 2023


================
@@ -129,7 +129,13 @@ class ByteCodeExprGen : public ConstStmtVisitor<ByteCodeExprGen<Emitter>, bool>,
 
   /// Classifies a type.
   std::optional<PrimType> classify(const Expr *E) const {
-    return E->isGLValue() ? PT_Ptr : classify(E->getType());
+    if (E->isGLValue()) {
+      if (E->getType()->isFunctionType())
+        return PT_FnPtr;
+      return PT_Ptr;
+    }
+
+    return classify(E->getType());
----------------
AaronBallman wrote:

Ah, let's pull those changes from this PR and land them separately then.

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


More information about the cfe-commits mailing list