[clang] [clang][ObjC][CodeComplete] Fix crash on C-Style cast with parenthesized operand in ObjC++ (PR #180343)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 13 14:40:30 PST 2026


================
@@ -5152,7 +5152,7 @@ void SemaCodeCompletion::CodeCompletePostfixExpression(Scope *S, ExprResult E,
                                                        QualType PreferredType) {
   if (E.isInvalid())
     CodeCompleteExpression(S, PreferredType);
-  else if (getLangOpts().ObjC)
+  else if (getLangOpts().ObjC && !E.get()->getType().isNull())
----------------
ojhunt wrote:

Move the validity check into CodeCompleteObjCInstanceMessage - no other sites seem to have a pattern that could encounter this, but there's no reason to leave the hazard

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


More information about the cfe-commits mailing list