]> granicus.if.org Git - clang/commitdiff
Fix for r42230, MSVC test failure in DependencyDirectivesSourceMinimizerTest.cpp
authorErich Keane <erich.keane@intel.com>
Tue, 11 Jun 2019 14:58:26 +0000 (14:58 +0000)
committerErich Keane <erich.keane@intel.com>
Tue, 11 Jun 2019 14:58:26 +0000 (14:58 +0000)
r362459 introduced DependencyDirectivesSourceMinimizerTest.cpp, which
hits an MSVC bug:
developercommunity.visualstudio.com/content/problem/67300/stringifying-raw-string-literal.html

This only happens when the parameter to a macro is stringified in the
macro.  This patch removes the string from the assert so that the
warning no longer happens.

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

unittests/Lex/DependencyDirectivesSourceMinimizerTest.cpp

index 7feb6c97fd17035a4a86e8935d2118170de00e36..d13723bdd1c664401bf0595a04a5832f2684a1f8 100644 (file)
@@ -405,25 +405,27 @@ TEST(MinimizeSourceToDependencyDirectivesTest, RawStringLiteral) {
                "#endif\n",
                Out.data());
 
-  ASSERT_FALSE(minimizeSourceToDependencyDirectives(
+  bool RawStringLiteralResult = minimizeSourceToDependencyDirectives(
       "#ifndef GUARD\n"
       "#define GUARD\n"
       R"raw(static constexpr char bytes[] = R"(-?:\,[]{}#&*!|>'"%@`)";)raw"
       "\n"
       "#endif\n",
-      Out));
+      Out);
+  ASSERT_FALSE(RawStringLiteralResult);
   EXPECT_STREQ("#ifndef GUARD\n"
                "#define GUARD\n"
                "#endif\n",
                Out.data());
 
-  ASSERT_FALSE(minimizeSourceToDependencyDirectives(
+  bool RawStringLiteralResult2 = minimizeSourceToDependencyDirectives(
       "#ifndef GUARD\n"
       "#define GUARD\n"
       R"raw(static constexpr char bytes[] = R"abc(-?:\,[]{}#&*!|>'"%@`)abc";)raw"
       "\n"
       "#endif\n",
-      Out));
+      Out);
+  ASSERT_FALSE(RawStringLiteralResult2);
   EXPECT_STREQ("#ifndef GUARD\n"
                "#define GUARD\n"
                "#endif\n",