From 91881d99f7ca2d554f03b4499983a46c03c23acd Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 29 Sep 2014 08:07:46 +0000 Subject: [PATCH] clang-format: Fix GCC warning about implicit bool pointer conversion. Introduced in r217880. llvm-svn: 218597 --- clang/unittests/Format/FormatTest.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index a88464f3824a..f44fec6fe987 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -8353,13 +8353,15 @@ TEST_F(FormatTest, GetsCorrectBasedOnStyle) { EXPECT_ALL_STYLES_EQUAL(Styles); } -#define CHECK_PARSE_BOOL(FIELD) \ +#define CHECK_PARSE_BOOL_FIELD(FIELD, CONFIG_NAME) \ Style.FIELD = false; \ - EXPECT_EQ(0, parseConfiguration(#FIELD ": true", &Style).value()); \ + EXPECT_EQ(0, parseConfiguration(CONFIG_NAME ": true", &Style).value()); \ EXPECT_TRUE(Style.FIELD); \ - EXPECT_EQ(0, parseConfiguration(#FIELD ": false", &Style).value()); \ + EXPECT_EQ(0, parseConfiguration(CONFIG_NAME ": false", &Style).value()); \ EXPECT_FALSE(Style.FIELD); +#define CHECK_PARSE_BOOL(FIELD) CHECK_PARSE_BOOL_FIELD(FIELD, #FIELD) + #define CHECK_PARSE(TEXT, FIELD, VALUE) \ EXPECT_NE(VALUE, Style.FIELD); \ EXPECT_EQ(0, parseConfiguration(TEXT, &Style).value()); \ @@ -8382,9 +8384,7 @@ TEST_F(FormatTest, ParsesConfigurationBools) { CHECK_PARSE_BOOL(BreakConstructorInitializersBeforeComma); CHECK_PARSE_BOOL(ConstructorInitializerAllOnOneLineOrOnePerLine); CHECK_PARSE_BOOL(DerivePointerAlignment); - // For backward compatibility: - CHECK_PARSE("DerivePointerBinding: true", DerivePointerAlignment, true); - CHECK_PARSE("DerivePointerBinding: false", DerivePointerAlignment, false); + CHECK_PARSE_BOOL_FIELD(DerivePointerAlignment, "DerivePointerBinding"); CHECK_PARSE_BOOL(IndentCaseLabels); CHECK_PARSE_BOOL(IndentWrappedFunctionNames); CHECK_PARSE_BOOL(KeepEmptyLinesAtTheStartOfBlocks);