diff options
author | Owen Pan <owenpiano@gmail.com> | 2025-03-16 16:11:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-16 16:11:39 -0700 |
commit | 91328dbae986dfa93cf2acef0a93361fd5ced66d (patch) | |
tree | a6ec8283abf53e72a7cf653a81c309be87941d9c /clang/lib/Format/FormatTokenLexer.cpp | |
parent | 950bc6cd77455b1ec1679cf9f125055e2de1910f (diff) | |
download | llvm-91328dbae986dfa93cf2acef0a93361fd5ced66d.zip llvm-91328dbae986dfa93cf2acef0a93361fd5ced66d.tar.gz llvm-91328dbae986dfa93cf2acef0a93361fd5ced66d.tar.bz2 |
[clang-format] Correctly annotate user-defined conversion functions (#131434)
Also fix/delete existing invalid/redundant test cases.
Fix #130894
Diffstat (limited to 'clang/lib/Format/FormatTokenLexer.cpp')
-rw-r--r-- | clang/lib/Format/FormatTokenLexer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Format/FormatTokenLexer.cpp b/clang/lib/Format/FormatTokenLexer.cpp index 16f0a76..eed54a1 100644 --- a/clang/lib/Format/FormatTokenLexer.cpp +++ b/clang/lib/Format/FormatTokenLexer.cpp @@ -610,9 +610,9 @@ bool FormatTokenLexer::precedesOperand(FormatToken *Tok) { tok::r_brace, tok::l_square, tok::semi, tok::exclaim, tok::colon, tok::question, tok::tilde) || Tok->isOneOf(tok::kw_return, tok::kw_do, tok::kw_case, tok::kw_throw, - tok::kw_else, tok::kw_new, tok::kw_delete, tok::kw_void, - tok::kw_typeof, Keywords.kw_instanceof, Keywords.kw_in) || - Tok->isBinaryOperator(); + tok::kw_else, tok::kw_void, tok::kw_typeof, + Keywords.kw_instanceof, Keywords.kw_in) || + Tok->isPlacementOperator() || Tok->isBinaryOperator(); } bool FormatTokenLexer::canPrecedeRegexLiteral(FormatToken *Prev) { |