llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/180722.diff


1 Files Affected:

- (modified) clang/lib/AST/ByteCode/Pointer.cpp (+1-2) 


``````````diff
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.

``````````

</details>


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

Reply via email to