================
@@ -3351,9 +3356,18 @@ class ExpressionParser {
// Consume scopes: (), [], <> and {}
// In addition to that we handle require clauses as scope, so that the
// constraints in that are correctly indented.
- if (Current->opensScope() ||
- Current->isOneOf(TT_RequiresClause,
+ if (Current->isOneOf(TT_RequiresClause,
TT_RequiresClauseInARequiresExpression)) {
+ const auto *End = Current;
+ while (End && !End->ClosesRequiresClause)
+ End = End->Next;
+
+ const auto *PreviousLimit = RequiresClauseLimit;
+ RequiresClauseLimit = End ? End->getNextNonComment() : PreviousLimit;
+ next();
+ parse();
+ RequiresClauseLimit = PreviousLimit;
----------------
abdulm5 wrote:
Added a formatting regression for an outer constraint containing a generic
lambda with its own requires clause. The inner clause temporarily replaces the
outer end marker, so restoring PreviousEnd is required to continue parsing the
outer constraint. As a mutation check, removing the restore made Bar<T> and the
following template declaration indent under the inner clause; the new test
catches that. The end lookup now also skips nested requires-clause closers.
https://github.com/llvm/llvm-project/pull/220792
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits