summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/unittests/Tooling/RecursiveASTVisitorTests/MemberPointerTypeLoc.cpp11
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
OpenPOWER on IntegriCloud