diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2023-04-22 13:38:13 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2023-04-22 13:38:13 +0000 |
| commit | 86321b98854d834e516cc65ddd09ef53e930fc4c (patch) | |
| tree | 41cca4d40c59161100bc4ddad210a20a65b90d57 /clang/lib/Format | |
| parent | 8a37c71e9d8855c91b9ef296ed389248f960bb52 (diff) | |
Diffstat (limited to 'clang/lib/Format')
| -rw-r--r-- | clang/lib/Format/Format.cpp | 10 | ||||
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 9 |
2 files changed, 6 insertions, 13 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 0d3fde90ab38..a59d53009eaa 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -721,23 +721,23 @@ template <> struct MappingTraits<FormatStyle::TrailingCommentsAlignmentStyle> { FormatStyle::TrailingCommentsAlignmentStyle &Value) { IO.enumCase(Value, "Leave", FormatStyle::TrailingCommentsAlignmentStyle( - {FormatStyle::TCAS_Leave, 1})); + {FormatStyle::TCAS_Leave, 0})); IO.enumCase(Value, "Always", FormatStyle::TrailingCommentsAlignmentStyle( - {FormatStyle::TCAS_Always, 1})); + {FormatStyle::TCAS_Always, 0})); IO.enumCase(Value, "Never", FormatStyle::TrailingCommentsAlignmentStyle( - {FormatStyle::TCAS_Never, 1})); + {FormatStyle::TCAS_Never, 0})); // For backwards compatibility IO.enumCase(Value, "true", FormatStyle::TrailingCommentsAlignmentStyle( - {FormatStyle::TCAS_Always, 1})); + {FormatStyle::TCAS_Always, 0})); IO.enumCase(Value, "false", FormatStyle::TrailingCommentsAlignmentStyle( - {FormatStyle::TCAS_Never, 1})); + {FormatStyle::TCAS_Never, 0})); } static void mapping(IO &IO, diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index ca651eaa9440..464594bf7488 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -399,8 +399,7 @@ private: FormatToken *Next = CurrentToken->Next; if (PrevPrev && PrevPrev->is(tok::identifier) && Prev->isOneOf(tok::star, tok::amp, tok::ampamp) && - CurrentToken->is(tok::identifier) && - !Next->isOneOf(tok::equal, tok::l_brace)) { + CurrentToken->is(tok::identifier) && Next->isNot(tok::equal)) { Prev->setType(TT_BinaryOperator); LookForDecls = false; } @@ -2399,12 +2398,6 @@ private: return TT_PointerOrReference; } - // if (Class* obj { function() }) - if (PrevToken->Tok.isAnyIdentifier() && NextToken->Tok.isAnyIdentifier() && - NextToken->Next && NextToken->Next->is(tok::l_brace)) { - return TT_PointerOrReference; - } - if (PrevToken->endsSequence(tok::r_square, tok::l_square, tok::kw_delete)) return TT_UnaryOperator; |
