]> granicus.if.org Git - clang/commitdiff
Fix ASTMatchersTraversalTest testcase compile on older compilers
authorDavid Green <david.green@arm.com>
Wed, 15 Aug 2018 10:39:43 +0000 (10:39 +0000)
committerDavid Green <david.green@arm.com>
Wed, 15 Aug 2018 10:39:43 +0000 (10:39 +0000)
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

unittests/ASTMatchers/ASTMatchersTraversalTest.cpp

index 52ab54467e5f1e9f9d1880a05807508f130af960..713fb5a5924694126c60563fe20babad8a713142 100644 (file)
@@ -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(