[clang] [ObjC] Fix Assertion failure when merging declarations with different lifetime qualifiers (PR #203272)

Akira Hatanaka via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 17 12:49:49 PDT 2026


Hendrik =?utf-8?q?Hübner?= <hhuebner at MacBookPro.localdomain>,
Hendrik =?utf-8?q?Hübner?= <hhuebner at MacBookPro.lan>,
Hendrik =?utf-8?q?Hübner?= <hhuebner at MacBookPro.localdomain>,
Hendrik =?utf-8?q?Hübner?= <hhuebner at MacBookPro.localdomain>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/203272 at github.com>


================
@@ -12339,7 +12339,7 @@ QualType ASTContext::mergeObjCGCQualifiers(QualType LHS, QualType RHS) {
       // id foo(); ... __strong id foo(); or: __strong id foo(); ... id foo();
       // In either case, use OldReturnType to build the new function type.
       const auto *F = LHS->castAs<FunctionType>();
-      if (const auto *FPT = cast<FunctionProtoType>(F)) {
+      if (const auto *FPT = cast_or_null<FunctionProtoType>(F)) {
----------------
ahatanak wrote:

This change isn't needed, right?

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


More information about the cfe-commits mailing list