[clang] [Sema] Decay functions/array to pointers in `IncompatiblePointerDiscardsQualifiers` and `IncompatibleOBTKinds` cases (PR #187038)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 30 07:56:47 PDT 2026


================
@@ -17669,6 +17651,12 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy,
   case AssignConvertType::CompatibleOBTDiscards:
     return false;
   case AssignConvertType::IncompatibleOBTKinds: {
+    if (SrcType->isArrayType())
----------------
AaronBallman wrote:

I think `SrcType->canDecayToPointerType()` might make more sense here as well, but I'd like to hear from @ojhunt (we'd just switch the `assert` to come first, but it would be functionally the same). But this would then handle `!isArrayParameterType()` case which was something I hadn't considered before.

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


More information about the cfe-commits mailing list