From 6a5cc2f6d8ddb91e800683ba1de850d4c429f086 Mon Sep 17 00:00:00 2001 From: Yuri Iozzelli Date: Fri, 3 May 2024 11:44:19 +0200 Subject: [PATCH] clang: allow addressof of non-client pointers in client namespace --- clang/lib/Sema/SemaCheerp.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaCheerp.cpp b/clang/lib/Sema/SemaCheerp.cpp index de27542c75d2..993181b89fa6 100644 --- a/clang/lib/Sema/SemaCheerp.cpp +++ b/clang/lib/Sema/SemaCheerp.cpp @@ -838,10 +838,13 @@ bool cheerp::canAddressOfClientBeTaken(const clang::VarDecl* VD, const clang::Se case TypeKind::UnsignedInt32Bit: case TypeKind::SignedInt32Bit: case TypeKind::FloatingPoint: - case TypeKind::Pointer: { return false; } + case TypeKind::Pointer: + { + return Ty->getPointeeType().getAddressSpace() != LangAS::cheerp_client; + } case TypeKind::Reference: { break;