aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/WhitespaceManager.cpp
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2023-10-03 18:02:09 -0700
committerowenca <owenpiano@gmail.com>2023-10-03 22:26:48 -0700
commit7e856d18943f637b8c83f0bf8cbb506c5f7e94af (patch)
treec1234f4a996cc76b6f4d00ece8f03992a59be6be /clang/lib/Format/WhitespaceManager.cpp
parent967767830d7b4947bc0d72e7160d9023aab9eddc (diff)
downloadllvm-7e856d18943f637b8c83f0bf8cbb506c5f7e94af.zip
llvm-7e856d18943f637b8c83f0bf8cbb506c5f7e94af.tar.gz
llvm-7e856d18943f637b8c83f0bf8cbb506c5f7e94af.tar.bz2
Reland "[clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (#67955)"
Reland 6a621ed8e4cb which failed on Windows but not macOS. The failures were caused by moving the annotation of the children from the top to the bottom of TokenAnnotator::annotate(), resulting in invalid lines including incomplete ones being skipped.
Diffstat (limited to 'clang/lib/Format/WhitespaceManager.cpp')
-rw-r--r--clang/lib/Format/WhitespaceManager.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp
index 2cbde3d..9061e07 100644
--- a/clang/lib/Format/WhitespaceManager.cpp
+++ b/clang/lib/Format/WhitespaceManager.cpp
@@ -975,11 +975,7 @@ void WhitespaceManager::alignConsecutiveDeclarations() {
AlignTokens(
Style,
[](Change const &C) {
- if (C.Tok->is(TT_FunctionDeclarationName) && C.Tok->Previous &&
- C.Tok->Previous->isNot(tok::tilde)) {
- return true;
- }
- if (C.Tok->is(TT_FunctionTypeLParen))
+ if (C.Tok->isOneOf(TT_FunctionDeclarationName, TT_FunctionTypeLParen))
return true;
if (C.Tok->isNot(TT_StartOfName))
return false;