[Tooling] Move raw string literal out of a macro call. NFC
authorIlya Biryukov <ibiryukov@google.com>
Thu, 12 Dec 2019 09:50:32 +0000 (10:50 +0100)
committerIlya Biryukov <ibiryukov@google.com>
Thu, 12 Dec 2019 09:53:20 +0000 (10:53 +0100)
Should fix buildbots with some older gcc versions.

clang/unittests/Tooling/RecursiveASTVisitorTests/MemberPointerTypeLoc.cpp

index d30a6ad..d67bd03 100644 (file)
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "TestVisitor.h"
+#include "llvm/ADT/StringRef.h"
 
 using namespace clang;
 
@@ -33,7 +34,7 @@ TEST(RecursiveASTVisitor, VisitTypeLocInMemberPointerTypeLoc) {
   MemberPointerTypeLocVisitor Visitor;
   Visitor.ExpectMatch("Bar", 4, 36);
   Visitor.ExpectMatch("T", 7, 23);
-  EXPECT_TRUE(Visitor.runOver(R"cpp(
+  llvm::StringLiteral Code = R"cpp(
      class Bar { void func(int); };
      class Foo {
        void bind(const char*, void(Bar::*Foo)(int)) {}
@@ -41,15 +42,17 @@ TEST(RecursiveASTVisitor, VisitTypeLocInMemberPointerTypeLoc) {
        template<typename T>
        void test(void(T::*Foo)());
      };
-  )cpp"));
+  )cpp";
+  EXPECT_TRUE(Visitor.runOver(Code));
 }
 
 TEST(RecursiveASTVisitor, NoCrash) {
   MemberPointerTypeLocVisitor Visitor;
-  EXPECT_FALSE(Visitor.runOver(R"cpp(
+  llvm::StringLiteral Code = R"cpp(
      // MemberPointerTypeLoc.getClassTInfo() is null.
      class a(b(a::*)) class
-  )cpp"));
+  )cpp";
+  EXPECT_FALSE(Visitor.runOver(Code));
 }
 
 } // end anonymous namespace