[clang] [clang][Sema] Fix access checking in nested concept-id substitution (PR #246811)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 30 03:09:40 PST 2026


================
@@ -812,7 +812,12 @@ ConstraintSatisfactionChecker::SubstitutionInTemplateArguments(
   // mappings to preserve the outer depths.
   if (S.SubstTemplateArgumentsInParameterMapping(
           Constraint.getParameterMapping(), Constraint.getBeginLoc(), MLTAL,
-          SubstArgs)) {
+          SubstArgs) ||
+      Trap.hasErrorOccurred()) {
+    // Access-control failures are diagnosed as SFINAE, so they don't make
+    // SubstTemplateArgumentsInParameterMapping return true. Check the trap
+    // as well, otherwise the constraint is incorrectly treated as satisfied.
+    // See https://github.com/llvm/llvm-project/issues/246008.
----------------
zyn0217 wrote:

```suggestion
```

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


More information about the cfe-commits mailing list