diff options
author | owenca <owenpiano@gmail.com> | 2022-07-15 23:17:42 -0700 |
---|---|---|
committer | owenca <owenpiano@gmail.com> | 2022-07-16 13:11:10 -0700 |
commit | a0458d92e9e7b279c9ff491429aad86ccedee7c4 (patch) | |
tree | 0495625f2856ee5f8e0f2280af632a66c11d0f01 /clang/unittests | |
parent | 2b2e858e9cbb1d459804f8e393ac6b90459ccb7a (diff) | |
download | llvm-a0458d92e9e7b279c9ff491429aad86ccedee7c4.zip llvm-a0458d92e9e7b279c9ff491429aad86ccedee7c4.tar.gz llvm-a0458d92e9e7b279c9ff491429aad86ccedee7c4.tar.bz2 |
[clang-format] Never remove braces in macro definitions
Fixes #56559.
Differential Revision: https://reviews.llvm.org/D129921
Diffstat (limited to 'clang/unittests')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 08cfdbe..6b7454f 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -25803,6 +25803,13 @@ TEST_F(FormatTest, RemoveBraces) { Style.ColumnLimit = 20; + verifyFormat("int i;\n" + "#define FOO(a, b) \\\n" + " while (a) { \\\n" + " b; \\\n" + " }", + Style); + verifyFormat("int ab = [](int i) {\n" " if (i > 0) {\n" " i = 12345678 -\n" |