https://github.com/HendrikHuebner updated https://github.com/llvm/llvm-project/pull/203272
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 1/2] [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 From 7b37b95ce45e0b3d8243e4a2624d42db3d35c795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hendrik=20H=C3=BCbner?= <[email protected]> Date: Thu, 11 Jun 2026 16:06:06 +0200 Subject: [PATCH 2/2] add test --- clang/test/SemaObjC/arc-repeated-weak.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/test/SemaObjC/arc-repeated-weak.mm b/clang/test/SemaObjC/arc-repeated-weak.mm index aaf8256d314ee..45b9816b42057 100644 --- a/clang/test/SemaObjC/arc-repeated-weak.mm +++ b/clang/test/SemaObjC/arc-repeated-weak.mm @@ -340,6 +340,9 @@ - (void)distinctFromOther:(Test *)other { } @end +extern id foo; // expected-note {{previous declaration is here}} +extern __weak id foo; // expected-error {{redeclaration of 'foo' with a different type}} + @interface Base1 @end @interface Sub1 : Base1 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
