(The slightly more usual fix is to do `const char kFoo[] = R"cpp(...)cpp"; EXPECT_TRUE(matches(kFoo...)`)
On Fri, Sep 6, 2019 at 3:13 PM Matthias Gehre via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: mgehre > Date: Fri Sep 6 12:15:02 2019 > New Revision: 371241 > > URL: http://llvm.org/viewvc/llvm-project?rev=371241&view=rev > Log: > [LifetimeAnalysis] don't use raw string literals in macros > > They broke the AArch64 bots (gcc does not support it) > > Modified: > cfe/trunk/unittests/Sema/GslOwnerPointerInference.cpp > > Modified: cfe/trunk/unittests/Sema/GslOwnerPointerInference.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Sema/GslOwnerPointerInference.cpp?rev=371241&r1=371240&r2=371241&view=diff > > ============================================================================== > --- cfe/trunk/unittests/Sema/GslOwnerPointerInference.cpp (original) > +++ cfe/trunk/unittests/Sema/GslOwnerPointerInference.cpp Fri Sep 6 > 12:15:02 2019 > @@ -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; > - > - template<class T> > - class [[gsl::Owner]] C {}; > - > - C<int> c; > - )cpp", > - classTemplateSpecializationDecl(hasName("C"), > hasAttr(clang::attr::Owner)))); > + EXPECT_TRUE(matches("template<class T>" > + "class [[gsl::Owner]] C;" > + > + "template<class T>" > + "class [[gsl::Owner]] C {};" > + > + "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; > - > - template<class T> > - class C {}; > - > - C<int> c; > - )cpp", > - classTemplateSpecializationDecl(hasName("C"), > hasAttr(clang::attr::Owner)))); > + EXPECT_TRUE(matches("template<class T>" > + "class [[gsl::Owner]] C;" > + > + "template<class T>" > + "class C {};" > + > + "C<int> c;", > + classTemplateSpecializationDecl( > + hasName("C"), hasAttr(clang::attr::Owner)))); > } > > TEST(OwnerPointer, LateForwardDeclOnly) { > - EXPECT_TRUE(matches( > - R"cpp( > - template<class T> > - class C; > - > - template<class T> > - class C {}; > - > - template<class T> > - class [[gsl::Owner]] C; > - > - C<int> c; > - )cpp", > - classTemplateSpecializationDecl(hasName("C"), > hasAttr(clang::attr::Owner)))); > + EXPECT_TRUE(matches("template<class T>" > + "class C;" > + > + "template<class T>" > + "class C {};" > + > + "template<class T>" > + "class [[gsl::Owner]] C;" > + > + "C<int> c;", > + classTemplateSpecializationDecl( > + hasName("C"), hasAttr(clang::attr::Owner)))); > } > > } // namespace clang > > > _______________________________________________ > cfe-commits mailing list > cfe-commits@lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits