================
@@ -812,7 +812,12 @@ 
ConstraintSatisfactionChecker::SubstitutionInTemplateArguments(
   // mappings to preserve the outer depths.
   if (S.SubstTemplateArgumentsInParameterMapping(
           Constraint.getParameterMapping(), Constraint.getBeginLoc(), MLTAL,
-          SubstArgs)) {
+          SubstArgs) ||
+      Trap.hasErrorOccurred()) {
----------------
ShashwatAgrawal20 wrote:

It is a bit odd. `SubstTemplateArgumentsInParameterMapping` reports failures 
through its return value, but access-control diagnostics are 
`SFINAE_AccessControl`: `Sema::EmitDiagnostic` records them on the active 
`SFINAETrap` and suppresses them, so the transform can complete and return 
success (`false`).

I checked the trap at the call site to match the existing patterns in this 
file: `EvaluateAtomicConstraint` (`isInvalid() || Trap.hasErrorOccurred()`) and 
`EvaluateSlow(ConceptIdConstraint)` (`SubstTemplateArguments(...) || 
Trap.hasErrorOccurred()`). I didn't move it into the helper because 
`SubstituteParameterMappings` also calls it during normalization under 
`Sema::NonSFINAEContext`, where there's no trap and these diagnostics should 
remain hard errors.

Happy to leave it as-is with the comment, or fold the check into the helper 
behind an active-SFINAE guard if you'd prefer that shape.

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

Reply via email to