[clang] [clang] treat deduced-as-dependent as undeduced for cosntant template parameters (PR #161099)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Sep 28 14:28:48 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Matheus Izvekov (mizvekov)
<details>
<summary>Changes</summary>
The AutoType's deduced-as-dependent mechanism is not really used for constant template parameters, but this is currently harmless to ignore because when dealing which such types, they will have been transformed, turning them back to plain undeduced AutoTypes.
This should be NFC for current main users, but https://github.com/llvm/llvm-project/pull/141776 will depend on this.
---
Full diff: https://github.com/llvm/llvm-project/pull/161099.diff
1 Files Affected:
- (modified) clang/lib/Sema/SemaTemplate.cpp (+1-1)
``````````diff
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 3ebbb30ae483e..2bf1511c5cfa0 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -7102,7 +7102,7 @@ ExprResult Sema::CheckTemplateArgument(NamedDecl *Param, QualType ParamType,
// If the parameter type somehow involves auto, deduce the type now.
DeducedType *DeducedT = ParamType->getContainedDeducedType();
- bool IsDeduced = DeducedT && !DeducedT->isDeduced();
+ bool IsDeduced = DeducedT && DeducedT->getDeducedType().isNull();
if (IsDeduced) {
// When checking a deduced template argument, deduce from its type even if
// the type is dependent, in order to check the types of non-type template
``````````
</details>
https://github.com/llvm/llvm-project/pull/161099
More information about the cfe-commits
mailing list