[clang] [Sema] Decay functions/array to pointers in `IncompatiblePointerDiscardsQualifiers` and `IncompatibleOBTKinds` cases (PR #187038)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 1 06:44:32 PDT 2026
================
@@ -17705,6 +17706,12 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy,
case AssignConvertType::CompatibleOBTDiscards:
return false;
case AssignConvertType::IncompatibleOBTKinds: {
+ assert(!SrcType->isFunctionType() &&
+ "Unexpected function type found in IncompatibleOBTKinds assignment");
+ if (SrcType->canDecayToPointerType()) {
+ SrcType = Context.getDecayedType(SrcType);
+ }
----------------
NeKon69 wrote:
Oh yeah I forget about this all the time
https://github.com/llvm/llvm-project/pull/187038
More information about the cfe-commits
mailing list