================ @@ -11429,6 +11429,16 @@ static bool CheckTargetCausesMultiVersioning(Sema &S, FunctionDecl *OldFD, bool &Redeclaration, NamedDecl *&OldDecl, LookupResult &Previous) { + assert(!OldFD->isMultiVersion() && "Unexpected MultiVersion"); + + // The definitions should be allowed in any order. If we have discovered + // a new target version and the preceeding was the default, then add the + // corresponding attribute to it. + if (OldFD->getMultiVersionKind() == MultiVersionKind::None && ---------------- ilinpv wrote:
Should it work for case target_version("default") declared first? It would good to add tests for various orders of function definition and target_version attributes. https://github.com/llvm/llvm-project/pull/83887 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits