[llvm-branch-commits] [clang] [Clang][CWG2369] Implement GCC's heuristic for DR 2369 (PR #124231)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jan 23 22:10:35 PST 2025


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 816bda32a6e9c52d93a06e6e19a5ac3fcbbbbc66 c36dd4fcac367b206072b36ccc9be4106a22ec3b --extensions cpp,h -- clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaOverload.cpp clang/lib/Sema/SemaTemplateDeduction.cpp clang/test/SemaTemplate/concepts-recursive-inst.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index fd4d1f7e0d..99ca651591 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -12273,7 +12273,9 @@ public:
       sema::TemplateDeductionInfo &Info,
       SmallVectorImpl<OriginalCallArg> const *OriginalCallArgs = nullptr,
       bool PartialOverloading = false,
-      llvm::function_ref<bool(bool)> CheckNonDependent = [](bool) { return false; });
+      llvm::function_ref<bool(bool)> CheckNonDependent = [](bool) {
+        return false;
+      });
 
   /// Perform template argument deduction from a function call
   /// (C++ [temp.deduct.call]).
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index aded8abe5b..6f3400cf79 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -7978,7 +7978,8 @@ bool Sema::CheckNonDependentConversions(
         // For members, 'this' got ConvIdx = 0 previously.
         ConvIdx = ThisConversions + I;
       }
-      if (NonInstOnly && ConversionMightInduceInstantiation(ParamType, Args[I]->getType()))
+      if (NonInstOnly &&
+          ConversionMightInduceInstantiation(ParamType, Args[I]->getType()))
         continue;
       Conversions[ConvIdx]
         = TryCopyInitialization(*this, Args[I], ParamType,
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index a44ad00d2c..dcaaed8613 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -4702,7 +4702,8 @@ TemplateDeductionResult Sema::DeduceTemplateArguments(
   runWithSufficientStackSpace(Info.getLocation(), [&] {
     Result = FinishTemplateArgumentDeduction(
         FunctionTemplate, Deduced, NumExplicitlySpecified, Specialization, Info,
-        &OriginalCallArgs, PartialOverloading, [&, CallingCtx](bool NonInstOnly) {
+        &OriginalCallArgs, PartialOverloading,
+        [&, CallingCtx](bool NonInstOnly) {
           ContextRAII SavedContext(*this, CallingCtx);
           return CheckNonDependent(ParamTypesForArgChecking, NonInstOnly);
         });

``````````

</details>


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


More information about the llvm-branch-commits mailing list