From: David Green Date: Wed, 15 Aug 2018 10:39:43 +0000 (+0000) Subject: Fix ASTMatchersTraversalTest testcase compile on older compilers X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=547357ad290d9997c9888836679b42e741cf2de9;p=clang Fix ASTMatchersTraversalTest testcase compile on older compilers Some versions of gcc, especially when invoked through ccache (-E), can have trouble with raw string literals inside macros. This moves the string out of the macro. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339759 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp b/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp index 52ab54467e..713fb5a592 100644 --- a/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp +++ b/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp @@ -1322,7 +1322,7 @@ TEST(IgnoringImplicit, MatchesImplicit) { } TEST(IgnoringImplicit, MatchesNestedImplicit) { - EXPECT_TRUE(matches(R"( + StringRef Code = R"( struct OtherType; @@ -1348,8 +1348,8 @@ int main() { SomeType i = something(); } -)" - , varDecl( +)"; + EXPECT_TRUE(matches(Code, varDecl( hasName("i"), hasInitializer(exprWithCleanups(has( cxxConstructExpr(has(expr(ignoringImplicit(cxxConstructExpr(