llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Younan Zhang (zyn0217)

<details>
<summary>Changes</summary>

As discussed in #<!-- -->183010, the name MLTAL::isAnyArgInstantiationDependent 
became misleading after that patch. For type template arguments, it now checks 
whether the canonical types are dependent, whereas for expression template 
arguments, it checks the dependence of the expressions themselves.

We turn to using TA::isDependent now.

One concern is that dependent expressions, such as sizeof(T), may no longer be 
protected from evaluation. But I think they should have been marked as type 
dependent by this point since we do not have canonical expressions.



---
Full diff: https://github.com/llvm/llvm-project/pull/185608.diff


2 Files Affected:

- (modified) clang/include/clang/Sema/Template.h (+2-3) 
- (modified) clang/lib/Sema/SemaConcept.cpp (+1-1) 


``````````diff
diff --git a/clang/include/clang/Sema/Template.h 
b/clang/include/clang/Sema/Template.h
index 0be46e69f1b6f..2215c5d610c94 100644
--- a/clang/include/clang/Sema/Template.h
+++ b/clang/include/clang/Sema/Template.h
@@ -185,13 +185,12 @@ enum class TemplateSubstitutionKind : char {
       return !(*this)(Depth, Index).isNull();
     }
 
-    bool isAnyArgInstantiationDependent(const ASTContext &C) const {
+    bool isAnyArgDependent(const ASTContext &C) const {
       for (ArgumentListLevel ListLevel : TemplateArgumentLists)
         for (const TemplateArgument &TA : ListLevel.Args)
           // There might be null template arguments representing unused 
template
           // parameter mappings in an MLTAL during concept checking.
-          if (!TA.isNull() &&
-              C.getCanonicalTemplateArgument(TA).isInstantiationDependent())
+          if (!TA.isNull() && C.getCanonicalTemplateArgument(TA).isDependent())
             return true;
       return false;
     }
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index 38791940247cb..a51c3545ac82b 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -1154,7 +1154,7 @@ static bool CheckConstraintSatisfaction(
     return false;
   }
 
-  if (TemplateArgsLists.isAnyArgInstantiationDependent(S.Context)) {
+  if (TemplateArgsLists.isAnyArgDependent(S.Context)) {
     // No need to check satisfaction for dependent constraint expressions.
     Satisfaction.IsSatisfied = true;
     return false;

``````````

</details>


https://github.com/llvm/llvm-project/pull/185608
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to