[clang] [clang][Sema] Resolving Inconsistent Arguments Panic in Variadic Template Variables (PR #70280)

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 19:09:39 PDT 2023


github-actions[bot] wrote:


<!--LLVM CODE FORMAT COMMENT: {clang-format}-->

:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 04ca1b6bd938646874b6518067f03515d88c3b5b e26572e5cf6ce85221bf25f74a1ace05240e910d -- clang/lib/Sema/SemaOverload.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 187922a86116..4e89f4f50b8a 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -11045,8 +11045,8 @@ static void DiagnoseBadConversion(Sema &S, OverloadCandidate *Cand,
   }
 
   bool isVariadic = false;
-  for(unsigned N = 0 ; N < Fn->getNumParams(); N++) {
-    if( Fn->getParamDecl(N)->isParameterPack()) {
+  for (unsigned N = 0; N < Fn->getNumParams(); N++) {
+    if (Fn->getParamDecl(N)->isParameterPack()) {
       isVariadic = true;
       break;
     }
@@ -11060,8 +11060,9 @@ static void DiagnoseBadConversion(Sema &S, OverloadCandidate *Cand,
   Expr *FromExpr = Conv.Bad.FromExpr;
   QualType FromTy = Conv.Bad.getFromType();
   QualType ToTy = Conv.Bad.getToType();
-  SourceRange ToParamRange =
-      !isObjectArgument && !isVariadic ? Fn->getParamDecl(I)->getSourceRange() : SourceRange();
+  SourceRange ToParamRange = !isObjectArgument && !isVariadic
+                                 ? Fn->getParamDecl(I)->getSourceRange()
+                                 : SourceRange();
 
   if (FromTy == S.Context.OverloadTy) {
     assert(FromExpr && "overload set argument came from implicit argument?");

``````````

</details>


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


More information about the cfe-commits mailing list