Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang-format] Treats &/&& as reference when followed by ',' or ')'
Ran into an issue where function declarations inside function scopes or uses of sizeof inside a function would treat the && in 'sizeof(Type &&)' as a binary operator. Attempt to fix this by assuming reference when followed by ',' or ')'. Also adds tests for these. Also hit an edge case in another test that treated "and" the same as "&&" since it parses as C++. Changed the "and" to "also" so it is no longer a keyword. Fixes #58923. Differential Revision: https://reviews.llvm.org/D137755
- Loading branch information
1 parent
96e2390
commit e864ac6
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters