[clang] [clang][Sema] Bugfix for choosing the more specialized overload (PR #83279)

via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 6 05:51:44 PST 2024


================
@@ -5568,12 +5576,28 @@ FunctionTemplateDecl *Sema::getMoreSpecializedTemplate(
   //   ... and if G has a trailing function parameter pack for which F does not
   //   have a corresponding parameter, and if F does not have a trailing
   //   function parameter pack, then F is more specialized than G.
-  FunctionDecl *FD1 = FT1->getTemplatedDecl();
-  FunctionDecl *FD2 = FT2->getTemplatedDecl();
-  unsigned NumParams1 = FD1->getNumParams();
-  unsigned NumParams2 = FD2->getNumParams();
-  bool Variadic1 = NumParams1 && FD1->parameters().back()->isParameterPack();
-  bool Variadic2 = NumParams2 && FD2->parameters().back()->isParameterPack();
+
+  SmallVector<QualType> param1;
----------------
whisperity wrote:

```suggestion
  SmallVector<QualType> Param1;
```

Ditto, everywhere!

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


More information about the cfe-commits mailing list