[clang] [clang][FMV] Do not omit explicit default target_version attribute. (PR #96628)

Alexandros Lamprineas via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 25 06:08:19 PDT 2024


================
@@ -11543,8 +11551,7 @@ static bool CheckTargetCausesMultiVersioning(Sema &S, FunctionDecl *OldFD,
   }
 
   // If this is 'default', permit the forward declaration.
-  if ((NewTA && NewTA->isDefaultVersion() && !OldTA) ||
-      (NewTVA && NewTVA->isDefaultVersion() && !OldTVA)) {
----------------
labrinea wrote:

This is wrong. The new declaration cannot be a redeclaration of the old, and at the same time to be causing Multiversioning. Getting past the early return (line 11538 with the new code) means the new declaration is causing Multiversioning, so at this point (line 11554 with the new code) redeclaration is not possible for the target_version attribute.

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


More information about the cfe-commits mailing list