[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 8 04:22:39 PDT 2024


================
@@ -5585,11 +5585,12 @@ bool Sema::CheckTemplateArgumentList(
     ContextRAII Context(*this, NewContext);
     CXXThisScopeRAII(*this, RD, ThisQuals, RD != nullptr);
 
-    MultiLevelTemplateArgumentList MLTAL = getTemplateInstantiationArgs(
-        Template, NewContext, /*Final=*/false, CanonicalConverted,
-        /*RelativeToPrimary=*/true,
-        /*Pattern=*/nullptr,
-        /*ForConceptInstantiation=*/true);
+    MultiLevelTemplateArgumentList MLTAL =
+        getTemplateInstantiationArgs(Template, Template->getDeclContext(),
+                                     /*Final=*/false, CanonicalConverted,
+                                     /*RelativeToPrimary=*/true,
+                                     /*Pattern=*/nullptr,
+                                     /*ForConceptInstantiation=*/true);
----------------
zyn0217 wrote:

The `NewContext` argument didn't actually make any difference to `getTemplateInstantiationArgs()` previously, as it would always move to `Template->getDeclContext()` for the next traversal if the Innermost parameter (which is `CanonicalConverted`) was present. So I changed it to `Template->getDeclContext()` to clarify the behavior.

However, I can revert the changes on `getTemplateInstantiationArgs()` after @sdkrystian's refactoring patch, so this is left only for the time being.

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


More information about the cfe-commits mailing list