aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/FormatTokenLexer.cpp
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2025-04-01 18:56:19 -0700
committerOwen Pan <owenpiano@gmail.com>2025-04-01 18:59:12 -0700
commit97dcbdef6089175c45e14fcbcf5c88b10233a79a (patch)
tree0df6a7f81e93b92bd8fb1deef48fc81f73c38297 /clang/lib/Format/FormatTokenLexer.cpp
parent55ac652745c6ec94477b1862018f477748faad15 (diff)
downloadllvm-97dcbdef6089175c45e14fcbcf5c88b10233a79a.zip
llvm-97dcbdef6089175c45e14fcbcf5c88b10233a79a.tar.gz
llvm-97dcbdef6089175c45e14fcbcf5c88b10233a79a.tar.bz2
Revert "[clang-format] Handle C++ keywords in other languages better (#132941)"
This reverts commit ab7cee8a0ecf29fdb47c64c8d431a694d63390d2 which had formatting errors.
Diffstat (limited to 'clang/lib/Format/FormatTokenLexer.cpp')
-rw-r--r--clang/lib/Format/FormatTokenLexer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Format/FormatTokenLexer.cpp b/clang/lib/Format/FormatTokenLexer.cpp
index 014b10b..eed54a1 100644
--- a/clang/lib/Format/FormatTokenLexer.cpp
+++ b/clang/lib/Format/FormatTokenLexer.cpp
@@ -1306,12 +1306,15 @@ FormatToken *FormatTokenLexer::getNextToken() {
FormatTok->isOneOf(tok::kw_struct, tok::kw_union, tok::kw_delete,
tok::kw_operator)) {
FormatTok->Tok.setKind(tok::identifier);
+ FormatTok->Tok.setIdentifierInfo(nullptr);
} else if (Style.isJavaScript() &&
FormatTok->isOneOf(tok::kw_struct, tok::kw_union,
tok::kw_operator)) {
FormatTok->Tok.setKind(tok::identifier);
+ FormatTok->Tok.setIdentifierInfo(nullptr);
} else if (Style.isTableGen() && !Keywords.isTableGenKeyword(*FormatTok)) {
FormatTok->Tok.setKind(tok::identifier);
+ FormatTok->Tok.setIdentifierInfo(nullptr);
}
} else if (FormatTok->is(tok::greatergreater)) {
FormatTok->Tok.setKind(tok::greater);