[clang] 36cb989 - [clang][bytecode] Only reject function types in Pointer::toRValue() (#180722)

via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 10 04:11:49 PST 2026


Author: Timm Baeder
Date: 2026-02-10T13:11:45+01:00
New Revision: 36cb9894b3eec301c1b2f92b5c05519ed1cea4fa

URL: https://github.com/llvm/llvm-project/commit/36cb9894b3eec301c1b2f92b5c05519ed1cea4fa
DIFF: https://github.com/llvm/llvm-project/commit/36cb9894b3eec301c1b2f92b5c05519ed1cea4fa.diff

LOG: [clang][bytecode] Only reject function types in Pointer::toRValue() (#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.

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Pointer.cpp

Removed: 
    


################################################################################
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