================ @@ -11947,24 +11939,8 @@ static bool CheckMultiVersionFunction(Sema &S, FunctionDecl *NewFD, FunctionDecl *OldFD = OldDecl->getAsFunction(); - if (!OldFD->isMultiVersion() && MVKind == MultiVersionKind::None) { - if (NewTVA || !OldFD->getAttr<TargetVersionAttr>()) - return false; - if (!NewFD->getType()->getAs<FunctionProtoType>()) { - // Multiversion declaration doesn't have prototype. - S.Diag(NewFD->getLocation(), diag::err_multiversion_noproto); - NewFD->setInvalidDecl(); - } else { - // No "target_version" attribute is equivalent to "default" attribute. - NewFD->addAttr(TargetVersionAttr::CreateImplicit( - S.Context, "default", NewFD->getSourceRange())); - NewFD->setIsMultiVersion(); - OldFD->setIsMultiVersion(); - OldDecl = OldFD; - Redeclaration = true; - } - return true; - } + if (!OldFD->isMultiVersion() && MVKind == MultiVersionKind::None) ---------------- tmatheson-arm wrote:
`!OldFD->isMultiVersion()` is asserted at the top of the function, so this looks unnecessary. However OldFD is redefined here. This is confusing. Does the original assert still hold with the new assignment? https://github.com/llvm/llvm-project/pull/96628 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits