Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang-format] Don't wrap struct return types as structs
When using BraceWrapping.AfterClass or BraceWrapping.AfterStruct, the token annotator relies on the first token of the line to determine if we're dealing with a struct or class, however, this check is faulty if it's actually a function with an elaborated struct/class return type, as is common in C. This patch skips the check if the brace is already annotated as FunctionLBrace, in which case we already know it's a function and should be treated as such. Fixes #58527 Reviewed By: HazardyKnusperkeks, owenpan Differential Revision: https://reviews.llvm.org/D146281
- Loading branch information
Showing
2 changed files
with
40 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