[clang] 7d77898 - [Tooling] Move raw string literal out of a macro call. NFC

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 12 01:54:10 PST 2019


Author: Ilya Biryukov
Date: 2019-12-12T10:53:20+01:00
New Revision: 7d7789899f4d4684dac51f265a47b049db4d09f2

URL: https://github.com/llvm/llvm-project/commit/7d7789899f4d4684dac51f265a47b049db4d09f2
DIFF: https://github.com/llvm/llvm-project/commit/7d7789899f4d4684dac51f265a47b049db4d09f2.diff

LOG: [Tooling] Move raw string literal out of a macro call. NFC

Should fix buildbots with some older gcc versions.

Added: 
    

Modified: 
    clang/unittests/Tooling/RecursiveASTVisitorTests/MemberPointerTypeLoc.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Tooling/RecursiveASTVisitorTests/MemberPointerTypeLoc.cpp b/clang/unittests/Tooling/RecursiveASTVisitorTests/MemberPointerTypeLoc.cpp
index d30a6ad22f07..d67bd0395a67 100644
--- a/clang/unittests/Tooling/RecursiveASTVisitorTests/MemberPointerTypeLoc.cpp
+++ b/clang/unittests/Tooling/RecursiveASTVisitorTests/MemberPointerTypeLoc.cpp
@@ -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


        


More information about the cfe-commits mailing list