[clang] [Clang] Implement CWG2900 (PR #224291)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 06:18:00 PDT 2026


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 origin/main HEAD --extensions cpp,h -- clang/test/SemaTemplate/temp_arg_nontype_arg_type.cpp clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaTemplate.cpp clang/lib/Sema/SemaTemplateDeduction.cpp clang/test/CXX/drs/cwg29xx.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 2288cd744..cde2f242f 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -5572,9 +5572,9 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param, TemplateArgumentLoc &ArgLoc,
     //   parameter of type decltype(auto) ([temp.func.order]), the declaration
     //   is ill-formed.
     auto isUndeducedAuto = [](QualType T, bool DecltypeAuto) {
-              const AutoType *AT = T->getContainedAutoType();
-              return AT && AT->isDecltypeAuto() == DecltypeAuto &&
-                     AT->getDeducedType().isNull();
+      const AutoType *AT = T->getContainedAutoType();
+      return AT && AT->isDecltypeAuto() == DecltypeAuto &&
+             AT->getDeducedType().isNull();
     };
     if (CTAI.PartialOrdering &&
         isUndeducedAuto(NTTPType, /*DecltypeAuto=*/false) &&

``````````

</details>


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


More information about the cfe-commits mailing list