diff options
author | Ilya Biryukov <ibiryukov@google.com> | 2019-12-12 10:50:32 +0100 |
---|---|---|
committer | Ilya Biryukov <ibiryukov@google.com> | 2019-12-12 10:53:20 +0100 |
commit | 7d7789899f4d4684dac51f265a47b049db4d09f2 (patch) | |
tree | 9c18d7614384cb16d8a6a0fdfcc20dd751b85cb3 | |
parent | bbd16b687641377c0ba54c8ceb1fc1ec4c0eb19a (diff) | |
download | bcm5719-llvm-7d7789899f4d4684dac51f265a47b049db4d09f2.tar.gz bcm5719-llvm-7d7789899f4d4684dac51f265a47b049db4d09f2.zip |
[Tooling] Move raw string literal out of a macro call. NFC
Should fix buildbots with some older gcc versions.
-rw-r--r-- | clang/unittests/Tooling/RecursiveASTVisitorTests/MemberPointerTypeLoc.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/clang/unittests/Tooling/RecursiveASTVisitorTests/MemberPointerTypeLoc.cpp b/clang/unittests/Tooling/RecursiveASTVisitorTests/MemberPointerTypeLoc.cpp index d30a6ad22f0..d67bd0395a6 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 |