[clang] [clang-format] Make some binary operations imply requires clause (PR #110942)
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 3 21:22:26 PDT 2024
================
@@ -3528,6 +3528,17 @@ bool UnwrappedLineParser::parseRequires() {
return false;
}
break;
+ case tok::equalequal:
+ case tok::greaterequal:
+ case tok::lessequal:
+ case tok::r_paren:
+ case tok::pipepipe:
+ if (OpenAngles == 0) {
+ FormatTok = Tokens->setPosition(StoredPosition);
+ parseRequiresClause(RequiresToken);
+ return true;
+ }
+ break;
----------------
owenca wrote:
If we are doing a limited fix now, maybe just move the `case tok::amp:` up as suggested above? It would cover patterns similar to that in #110485 no matter what operator is used in the parenthesized expression after `& requires`.
https://github.com/llvm/llvm-project/pull/110942
More information about the cfe-commits
mailing list