From: Erich Keane Date: Tue, 11 Jun 2019 14:58:26 +0000 (+0000) Subject: Fix for r42230, MSVC test failure in DependencyDirectivesSourceMinimizerTest.cpp X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c9aa3b78b93f09fabb798841790afaacfc670beb;p=clang Fix for r42230, MSVC test failure in DependencyDirectivesSourceMinimizerTest.cpp 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 --- diff --git a/unittests/Lex/DependencyDirectivesSourceMinimizerTest.cpp b/unittests/Lex/DependencyDirectivesSourceMinimizerTest.cpp index 7feb6c97fd..d13723bdd1 100644 --- a/unittests/Lex/DependencyDirectivesSourceMinimizerTest.cpp +++ b/unittests/Lex/DependencyDirectivesSourceMinimizerTest.cpp @@ -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",