https://github.com/HendrikHuebner created 
https://github.com/llvm/llvm-project/pull/203272

Fixes #150403

cc: @rjmccall 

From 9b78ed33016420997619a0cda5d318ef01aa15b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hendrik=20H=C3=BCbner?= <[email protected]>
Date: Thu, 11 Jun 2026 15:55:55 +0200
Subject: [PATCH] [ObjC] Fix Assertion failure when merging declarations with
 different lifetime qualifiers

Fixes #150403
---
 clang/lib/AST/ASTContext.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index abf0cd5e18c2b..e936572458444 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -12356,7 +12356,8 @@ QualType ASTContext::mergeObjCGCQualifiers(QualType 
LHS, QualType RHS) {
   if (LQuals != RQuals) {
     // If any of these qualifiers are different, we have a type mismatch.
     if (LQuals.getCVRQualifiers() != RQuals.getCVRQualifiers() ||
-        LQuals.getAddressSpace() != RQuals.getAddressSpace())
+        LQuals.getAddressSpace() != RQuals.getAddressSpace() ||
+        LQuals.getObjCLifetime() != RQuals.getObjCLifetime())
       return {};
 
     // Exactly one GC qualifier difference is allowed: __strong is

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

Reply via email to