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?= <[email protected]>
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.

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

Reply via email to