[clang] 3e6d629 - Revert "[clang-format][NFC] Remove a redundant isLiteral() call"
Gulfem Savrun Yeniceri via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 20 14:15:17 PST 2023
Author: Gulfem Savrun Yeniceri
Date: 2023-11-20T22:15:07Z
New Revision: 3e6d629ccff6e3561be07f66f8f0dc2774dab279
URL: https://github.com/llvm/llvm-project/commit/3e6d629ccff6e3561be07f66f8f0dc2774dab279
DIFF: https://github.com/llvm/llvm-project/commit/3e6d629ccff6e3561be07f66f8f0dc2774dab279.diff
LOG: Revert "[clang-format][NFC] Remove a redundant isLiteral() call"
This reverts commit f6033699646b7650123a273c043a93e5eeaac6d8.
This change is labeled as NFC, but introduces a functional change
without a test, and caused a breakage as reported in
https://reviews.llvm.org/rGf6033699646b7650123a273c043a93e5eeaac6d8.
Added:
Modified:
clang/lib/Format/TokenAnnotator.cpp
Removed:
################################################################################
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index cfca7c00312aab3..1d00dc569bb840e 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -3409,8 +3409,10 @@ static bool isFunctionDeclarationName(bool IsCpp, const FormatToken &Current,
Tok->isOneOf(TT_PointerOrReference, TT_StartOfName, tok::ellipsis)) {
return true;
}
- if (Tok->isOneOf(tok::l_brace, TT_ObjCMethodExpr) || Tok->Tok.isLiteral())
+ if (Tok->isOneOf(tok::l_brace, tok::string_literal, TT_ObjCMethodExpr) ||
+ Tok->Tok.isLiteral()) {
return false;
+ }
}
return false;
}
More information about the cfe-commits
mailing list