diff options
author | Owen Pan <owenpiano@gmail.com> | 2025-01-27 00:11:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-27 00:11:18 -0800 |
commit | 9452ee4f750a849148a391ac75eb31220343fa1e (patch) | |
tree | 50cae4c397f415e0326aa1977d1cb15b4417b92e /clang/lib/Format/UnwrappedLineParser.cpp | |
parent | 6805d7e8aa5f2ecea021acbb8c6b4c29ca432e78 (diff) | |
download | llvm-9452ee4f750a849148a391ac75eb31220343fa1e.zip llvm-9452ee4f750a849148a391ac75eb31220343fa1e.tar.gz llvm-9452ee4f750a849148a391ac75eb31220343fa1e.tar.bz2 |
[clang-format] Treat uppercase identifiers after struct as macros (#124397)
This restores the behavior before llvmorg-20-init.
Fixes #94184.
Fixes #117477.
Fixes #122690.
Fixes #123142.
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 4258329..906fc11 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -4075,7 +4075,8 @@ void UnwrappedLineParser::parseRecord(bool ParseAsExpr) { break; default: if (!JSPastExtendsOrImplements && !ClassName && - Previous->is(tok::identifier) && Previous->isNot(TT_AttributeMacro)) { + Previous->is(tok::identifier) && Previous->isNot(TT_AttributeMacro) && + Previous->TokenText != Previous->TokenText.upper()) { ClassName = Previous; } } |