================
@@ -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:

I think its needed, its for the nested require clauses. So while parsing an 
outer requires clause, parse() could encounter an inner requires clause and end 
the boundary. I think restoring it ensures that the parsing still stops at the 
end of the outer clause, so thats why I added the nested regression test.

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

Reply via email to