]> granicus.if.org Git - clang/commitdiff
clang-format: Fix GCC warning about implicit bool pointer conversion.
authorDaniel Jasper <djasper@google.com>
Mon, 29 Sep 2014 08:07:46 +0000 (08:07 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 29 Sep 2014 08:07:46 +0000 (08:07 +0000)
Introduced in r217880.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218597 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Format/FormatTest.cpp

index a88464f3824aec65f78bda115990b0e7380028d4..f44fec6fe987c26b54dc972447a56c645195efbb 100644 (file)
@@ -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);