[clang] [clang-format] Rename variable more sensitively (PR #100943)
Nathan Sidwell via cfe-commits
cfe-commits at lists.llvm.org
Sun Jul 28 11:02:20 PDT 2024
https://github.com/urnathan created https://github.com/llvm/llvm-project/pull/100943
I noticed the insensitively named `Blacklist` variable when looking at https://github.com/llvm/llvm-project/pull/100852. Let's renaming to `Disallowed`.
>From 9159beaeec23ea5336e62ba1b7710d784bba17f3 Mon Sep 17 00:00:00 2001
From: Nathan Sidwell <nathan at acm.org>
Date: Sun, 28 Jul 2024 13:59:12 -0400
Subject: [PATCH] [clang-format] Rename variable more sensitively
---
clang/lib/Format/UnwrappedLineParser.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index d406a531a5c0c..ed056b9dd5b75 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -2554,7 +2554,7 @@ bool UnwrappedLineParser::parseParens(TokenType AmpAmpTokenType) {
const bool DoubleParens =
Prev && Prev->is(tok::l_paren) && Next && Next->is(tok::r_paren);
const auto *PrevPrev = Prev ? Prev->getPreviousNonComment() : nullptr;
- const bool Blacklisted =
+ const bool Disallowed =
PrevPrev &&
(PrevPrev->isOneOf(tok::kw___attribute, tok::kw_decltype) ||
(SeenEqual &&
@@ -2566,7 +2566,7 @@ bool UnwrappedLineParser::parseParens(TokenType AmpAmpTokenType) {
(!NestedLambdas.empty() && !NestedLambdas.back())) &&
Prev && Prev->isOneOf(tok::kw_return, tok::kw_co_return) && Next &&
Next->is(tok::semi);
- if ((DoubleParens && !Blacklisted) || ReturnParens) {
+ if ((DoubleParens && !Disallowed) || ReturnParens) {
LeftParen->Optional = true;
FormatTok->Optional = true;
}
More information about the cfe-commits
mailing list