[llvm] [clang-tools-extra] [clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2024-01-11 Thread via cfe-commits
https://github.com/r4nt closed https://github.com/llvm/llvm-project/pull/76245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2024-01-10 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/76245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2024-01-10 Thread via cfe-commits
https://github.com/r4nt updated https://github.com/llvm/llvm-project/pull/76245 >From 52cb11f0279dbd9f65f15e81f44869cfac00d544 Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Thu, 2 Mar 2023 14:00:35 + Subject: [PATCH 1/3] [ClangFormat] Fix formatting bugs. 1. There are multiple calls to

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2024-01-09 Thread Owen Pan via cfe-commits
@@ -255,6 +255,41 @@ TEST_F(FormatTestMacroExpansion, Style); } +TEST_F(FormatTestMacroExpansion, CommaAsOperator) { + FormatStyle Style = getGoogleStyle(); + Style.ColumnLimit = 42; + Style.Macros.push_back("MACRO(a, b, c)=a=(b); if(x) c"); + veri

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2024-01-09 Thread Owen Pan via cfe-commits
@@ -255,6 +255,41 @@ TEST_F(FormatTestMacroExpansion, Style); } +TEST_F(FormatTestMacroExpansion, CommaAsOperator) { + FormatStyle Style = getGoogleStyle(); + Style.ColumnLimit = 42; + Style.Macros.push_back("MACRO(a, b, c)=a=(b); if(x) c"); + veri

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2024-01-09 Thread Owen Pan via cfe-commits
@@ -255,6 +255,41 @@ TEST_F(FormatTestMacroExpansion, Style); } +TEST_F(FormatTestMacroExpansion, CommaAsOperator) { + FormatStyle Style = getGoogleStyle(); + Style.ColumnLimit = 42; + Style.Macros.push_back("MACRO(a, b, c)=a=(b); if(x) c"); + veri

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2024-01-09 Thread Owen Pan via cfe-commits
@@ -255,6 +255,41 @@ TEST_F(FormatTestMacroExpansion, Style); } +TEST_F(FormatTestMacroExpansion, CommaAsOperator) { + FormatStyle Style = getGoogleStyle(); + Style.ColumnLimit = 42; + Style.Macros.push_back("MACRO(a, b, c)=a=(b); if(x) c"); + veri

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2024-01-09 Thread Owen Pan via cfe-commits
@@ -255,6 +255,41 @@ TEST_F(FormatTestMacroExpansion, Style); } +TEST_F(FormatTestMacroExpansion, CommaAsOperator) { + FormatStyle Style = getGoogleStyle(); + Style.ColumnLimit = 42; owenca wrote: ```suggestion FormatStyle Style =

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2024-01-09 Thread via cfe-commits
https://github.com/r4nt commented: Addressed review comments. https://github.com/llvm/llvm-project/pull/76245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2024-01-09 Thread via cfe-commits
https://github.com/r4nt updated https://github.com/llvm/llvm-project/pull/76245 >From 52cb11f0279dbd9f65f15e81f44869cfac00d544 Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Thu, 2 Mar 2023 14:00:35 + Subject: [PATCH 1/2] [ClangFormat] Fix formatting bugs. 1. There are multiple calls to

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2023-12-31 Thread Owen Pan via cfe-commits
@@ -2919,6 +2912,12 @@ class ExpressionParser { void addFakeParenthesis(FormatToken *Start, prec::Level Precedence, FormatToken *End = nullptr) { +// Do not assign fake parenthesis to tokens that are part of an +// unexpanded macro call. The

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2023-12-31 Thread Owen Pan via cfe-commits
@@ -255,6 +255,44 @@ TEST_F(FormatTestMacroExpansion, Style); } +TEST_F(FormatTestMacroExpansion, CommaAsOperator) { + FormatStyle Style = getGoogleStyle(); + Style.Macros.push_back("ASSIGN_OR_RETURN(a, b, c)=a=(b); if(x) c"); + verifyFormat(R"(ASSI

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2023-12-31 Thread Owen Pan via cfe-commits
@@ -255,6 +255,44 @@ TEST_F(FormatTestMacroExpansion, Style); } +TEST_F(FormatTestMacroExpansion, CommaAsOperator) { + FormatStyle Style = getGoogleStyle(); + Style.Macros.push_back("ASSIGN_OR_RETURN(a, b, c)=a=(b); if(x) c"); + verifyFormat(R"(ASSI

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2023-12-31 Thread Owen Pan via cfe-commits
@@ -416,10 +421,15 @@ struct FormatToken { /// to another one please use overwriteFixedType, or even better remove the /// need to reassign the type. void setFinalizedType(TokenType T) { +if (MacroCtx && MacroCtx->Role == MR_UnexpandedArg) + return; + ---

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2023-12-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: None (r4nt) Changes 1. There are multiple calls to addFakeParenthesis; move the guard to not assign fake parenthesis into the function to make sure we cover all calls. 2. MustBreakBefore can be set on a token in two cases: eith

[clang] [ClangFormat] Fix formatting bugs. (PR #76245)

2023-12-22 Thread via cfe-commits
https://github.com/r4nt created https://github.com/llvm/llvm-project/pull/76245 1. There are multiple calls to addFakeParenthesis; move the guard to not assign fake parenthesis into the function to make sure we cover all calls. 2. MustBreakBefore can be set on a token in two cases: either d