llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) <details> <summary>Changes</summary> This can't be tested right now but will show up once we use the new interpreter in evaluateAsConstantExpression() as well. Pulled out from https://github.com/llvm/llvm-project/pull/70763 --- Full diff: https://github.com/llvm/llvm-project/pull/72269.diff 1 Files Affected: - (modified) clang/lib/AST/Interp/ByteCodeExprGen.h (+7-1) ``````````diff diff --git a/clang/lib/AST/Interp/ByteCodeExprGen.h b/clang/lib/AST/Interp/ByteCodeExprGen.h index ec9b6bb1408453c..2a75f22e13bed60 100644 --- a/clang/lib/AST/Interp/ByteCodeExprGen.h +++ b/clang/lib/AST/Interp/ByteCodeExprGen.h @@ -130,7 +130,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()); } std::optional<PrimType> classify(QualType Ty) const { return Ctx.classify(Ty); `````````` </details> https://github.com/llvm/llvm-project/pull/72269 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits