Skip to content

Commit

Permalink
[LifetimeAnalysis] don't use raw string literals in macros
Browse files Browse the repository at this point in the history
They broke the AArch64 bots (gcc does not support it)

llvm-svn: 371241
  • Loading branch information
mgehre committed Sep 6, 2019
1 parent 0364d89 commit 4934f01
Showing 1 changed file with 23 additions and 29 deletions.
52 changes: 23 additions & 29 deletions clang/unittests/Sema/GslOwnerPointerInference.cpp
Expand Up @@ -14,48 +14,42 @@ namespace clang {
using namespace ast_matchers;

TEST(OwnerPointer, BothHaveAttributes) {
EXPECT_TRUE(matches(
R"cpp(
template<class T>
class [[gsl::Owner]] C;
EXPECT_TRUE(matches("template<class T>"
"class [[gsl::Owner]] C;"

template<class T>
class [[gsl::Owner]] C {};
"template<class T>"
"class [[gsl::Owner]] C {};"

C<int> c;
)cpp",
classTemplateSpecializationDecl(hasName("C"), hasAttr(clang::attr::Owner))));
"C<int> c;",
classTemplateSpecializationDecl(
hasName("C"), hasAttr(clang::attr::Owner))));
}

TEST(OwnerPointer, ForwardDeclOnly) {
EXPECT_TRUE(matches(
R"cpp(
template<class T>
class [[gsl::Owner]] C;
EXPECT_TRUE(matches("template<class T>"
"class [[gsl::Owner]] C;"

template<class T>
class C {};
"template<class T>"
"class C {};"

C<int> c;
)cpp",
classTemplateSpecializationDecl(hasName("C"), hasAttr(clang::attr::Owner))));
"C<int> c;",
classTemplateSpecializationDecl(
hasName("C"), hasAttr(clang::attr::Owner))));
}

TEST(OwnerPointer, LateForwardDeclOnly) {
EXPECT_TRUE(matches(
R"cpp(
template<class T>
class C;
EXPECT_TRUE(matches("template<class T>"
"class C;"

template<class T>
class C {};
"template<class T>"
"class C {};"

template<class T>
class [[gsl::Owner]] C;
"template<class T>"
"class [[gsl::Owner]] C;"

C<int> c;
)cpp",
classTemplateSpecializationDecl(hasName("C"), hasAttr(clang::attr::Owner))));
"C<int> c;",
classTemplateSpecializationDecl(
hasName("C"), hasAttr(clang::attr::Owner))));
}

} // namespace clang

0 comments on commit 4934f01

Please sign in to comment.