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

Hendrik Hübner via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 28 06:20:59 PDT 2026


================
@@ -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)) {
----------------
HendrikHuebner wrote:

Hi, sorry for taking so long to come back to this - I kind of forgot about this PR.

This change isn't strictly necessary but it silences a clang tidy warning and its near my other changes, so I thought it's fine to add it here.

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


More information about the cfe-commits mailing list