aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/clang16
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-03-18 20:06:45 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-03-18 20:48:34 +0300
commit6a266f4c8ba6cbf8f1e55fc9dd82bbdecdbf1735 (patch)
tree242b6b8dc8fefff3506739bb9ec0feb0d1cdf460 /contrib/libs/clang16
parent6fe550f9b51d64dadcca2173a7c29107f9c9f38e (diff)
downloadydb-6a266f4c8ba6cbf8f1e55fc9dd82bbdecdbf1735.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/libs/clang16')
-rw-r--r--contrib/libs/clang16/lib/Format/ContinuationIndenter.cpp6
-rw-r--r--contrib/libs/clang16/lib/Format/TokenAnnotator.cpp6
2 files changed, 9 insertions, 3 deletions
diff --git a/contrib/libs/clang16/lib/Format/ContinuationIndenter.cpp b/contrib/libs/clang16/lib/Format/ContinuationIndenter.cpp
index 62e008f29c..98b511f00b 100644
--- a/contrib/libs/clang16/lib/Format/ContinuationIndenter.cpp
+++ b/contrib/libs/clang16/lib/Format/ContinuationIndenter.cpp
@@ -280,6 +280,12 @@ LineState ContinuationIndenter::getInitialState(unsigned FirstIndent,
bool ContinuationIndenter::canBreak(const LineState &State) {
const FormatToken &Current = *State.NextToken;
const FormatToken &Previous = *Current.Previous;
+
+ // Breaking after a comma should always be allowed.
+ if (Previous.is(tok::comma)) {
+ return true;
+ }
+
const auto &CurrentState = State.Stack.back();
assert(&Previous == Current.Previous);
if (!Current.CanBreakBefore && !(CurrentState.BreakBeforeClosingBrace &&
diff --git a/contrib/libs/clang16/lib/Format/TokenAnnotator.cpp b/contrib/libs/clang16/lib/Format/TokenAnnotator.cpp
index f60a68d0a2..93c9a32739 100644
--- a/contrib/libs/clang16/lib/Format/TokenAnnotator.cpp
+++ b/contrib/libs/clang16/lib/Format/TokenAnnotator.cpp
@@ -3847,14 +3847,14 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line,
if (Right.is(tok::colon)) {
auto n = Right.Next;
- if (n && n->isOneOf(tok::kw_public, tok::kw_private, tok::kw_protected)) {
- return false;
+ if (n && n->isOneOf(tok::kw_public, tok::kw_private, tok::kw_protected, tok::kw_virtual)) {
+ return Style.SpaceBeforeInheritanceColon;
}
auto p = Left.Previous;
if (p && p->isOneOf(tok::kw_class, tok::kw_struct, tok::kw_enum)) {
- return false;
+ return Style.SpaceBeforeInheritanceColon;
}
}