[clang] [clang][bytecode] Only reject function tyeps in Pointer::toRValue() (PR #180722)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 10 03:18:43 PST 2026
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/180722
No test because I'm not sure how to reproduce this, but this patch fixes `CodeGen/ptrauth-qualifier-function.c`.
For function pointer types and function reference types, we use `Pointer`s these days, so we _can_ return them.
>From 02ca8f00fbe78b7a14f874deadd29f23a5a2d1c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Tue, 10 Feb 2026 12:15:48 +0100
Subject: [PATCH] [clang][bytecode] Only reject function tyeps in
Pointer::toRValue()
No test because I'm not sure how to reproduce this, but this patch fixes
`CodeGen/ptrauth-qualifier-function.c`.
For function pointer types and function reference types, we use `Pointer`s
these days, so we _can_ return them.
---
clang/lib/AST/ByteCode/Pointer.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/clang/lib/AST/ByteCode/Pointer.cpp b/clang/lib/AST/ByteCode/Pointer.cpp
index 8b496c5663ae6..e237013f4199c 100644
--- a/clang/lib/AST/ByteCode/Pointer.cpp
+++ b/clang/lib/AST/ByteCode/Pointer.cpp
@@ -938,8 +938,7 @@ std::optional<APValue> Pointer::toRValue(const Context &Ctx,
};
// Can't return functions as rvalues.
- if (ResultType->isFunctionType() || ResultType->isFunctionPointerType() ||
- ResultType->isFunctionReferenceType())
+ if (ResultType->isFunctionType())
return std::nullopt;
// Invalid to read from.
More information about the cfe-commits
mailing list