From: Dmitri Gribenko Date: Fri, 31 Aug 2012 03:05:44 +0000 (+0000) Subject: DeclPrinter tests: since now some platforms use C++11 by default, make it X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44470efba52b730fa1874eea9caacd2839a1af22;p=clang DeclPrinter tests: since now some platforms use C++11 by default, make it explicitly visible in test cases which language variant is used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162974 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/AST/DeclPrinterTest.cpp b/unittests/AST/DeclPrinterTest.cpp index 2800df4caf..47afb0d4d1 100644 --- a/unittests/AST/DeclPrinterTest.cpp +++ b/unittests/AST/DeclPrinterTest.cpp @@ -73,8 +73,6 @@ bool runToolOnCode(clang::FrontendAction *ToolAction, const Twine &Code, std::vector ArgVector; ArgVector.push_back("clang-tool"); ArgVector.push_back("-fsyntax-only"); - // operator delete (void*) grows a "noexcept" in c++11. - ArgVector.push_back("-std=c++98"); ArgVector.push_back(FileNameRef.data()); for (unsigned i = 0, e = ClangArgs.size(); i != e; ++i) ArgVector.push_back(ClangArgs[i]); @@ -118,21 +116,21 @@ bool runToolOnCode(clang::FrontendAction *ToolAction, const Twine &Code, return ::testing::AssertionSuccess(); } -::testing::AssertionResult PrintedDeclMatches(StringRef Code, - StringRef DeclName, - StringRef ExpectedPrinted) { +::testing::AssertionResult PrintedDeclCXX98Matches(StringRef Code, + StringRef DeclName, + StringRef ExpectedPrinted) { return PrintedDeclMatches(Code, - ArrayRef(), + ArrayRef("-std=c++98"), namedDecl(hasName(DeclName)).bind("id"), ExpectedPrinted); } -::testing::AssertionResult PrintedDeclMatches( +::testing::AssertionResult PrintedDeclCXX98Matches( StringRef Code, const DeclarationMatcher &NodeMatch, StringRef ExpectedPrinted) { return PrintedDeclMatches(Code, - ArrayRef(), + ArrayRef("-std=c++98"), NodeMatch, ExpectedPrinted); } @@ -159,7 +157,7 @@ bool runToolOnCode(clang::FrontendAction *ToolAction, const Twine &Code, } // unnamed namespace TEST(DeclPrinter, TestNamespace1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "namespace A { int B; }", "A", "namespace A {\n}")); @@ -175,7 +173,7 @@ TEST(DeclPrinter, TestNamespace2) { } TEST(DeclPrinter, TestNamespaceAlias1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "namespace Z { }" "namespace A = Z;", "A", @@ -184,7 +182,7 @@ TEST(DeclPrinter, TestNamespaceAlias1) { } TEST(DeclPrinter, TestNamespaceAlias2) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "namespace X { namespace Y {} }" "namespace A = X::Y;", "A", @@ -193,7 +191,7 @@ TEST(DeclPrinter, TestNamespaceAlias2) { } TEST(DeclPrinter, TestCXXRecordDecl1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "class A { int a; };", "A", "class A {\n}")); @@ -201,7 +199,7 @@ TEST(DeclPrinter, TestCXXRecordDecl1) { } TEST(DeclPrinter, TestCXXRecordDecl2) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct A { int a; };", "A", "struct A {\n}")); @@ -209,7 +207,7 @@ TEST(DeclPrinter, TestCXXRecordDecl2) { } TEST(DeclPrinter, TestCXXRecordDecl3) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "union A { int a; };", "A", "union A {\n}")); @@ -217,7 +215,7 @@ TEST(DeclPrinter, TestCXXRecordDecl3) { } TEST(DeclPrinter, TestCXXRecordDecl4) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "class Z { int a; };" "class A : Z { int b; };", "A", @@ -226,7 +224,7 @@ TEST(DeclPrinter, TestCXXRecordDecl4) { } TEST(DeclPrinter, TestCXXRecordDecl5) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct Z { int a; };" "struct A : Z { int b; };", "A", @@ -235,7 +233,7 @@ TEST(DeclPrinter, TestCXXRecordDecl5) { } TEST(DeclPrinter, TestCXXRecordDecl6) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "class Z { int a; };" "class A : public Z { int b; };", "A", @@ -244,7 +242,7 @@ TEST(DeclPrinter, TestCXXRecordDecl6) { } TEST(DeclPrinter, TestCXXRecordDecl7) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "class Z { int a; };" "class A : protected Z { int b; };", "A", @@ -253,7 +251,7 @@ TEST(DeclPrinter, TestCXXRecordDecl7) { } TEST(DeclPrinter, TestCXXRecordDecl8) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "class Z { int a; };" "class A : private Z { int b; };", "A", @@ -262,7 +260,7 @@ TEST(DeclPrinter, TestCXXRecordDecl8) { } TEST(DeclPrinter, TestCXXRecordDecl9) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "class Z { int a; };" "class A : virtual Z { int b; };", "A", @@ -271,7 +269,7 @@ TEST(DeclPrinter, TestCXXRecordDecl9) { } TEST(DeclPrinter, TestCXXRecordDecl10) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "class Z { int a; };" "class A : virtual public Z { int b; };", "A", @@ -280,7 +278,7 @@ TEST(DeclPrinter, TestCXXRecordDecl10) { } TEST(DeclPrinter, TestCXXRecordDecl11) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "class Z { int a; };" "class Y : virtual public Z { int b; };" "class A : virtual public Z, private Y { int c; };", @@ -290,7 +288,7 @@ TEST(DeclPrinter, TestCXXRecordDecl11) { } TEST(DeclPrinter, TestFunctionDecl1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "void A();", "A", "void A()")); @@ -298,7 +296,7 @@ TEST(DeclPrinter, TestFunctionDecl1) { } TEST(DeclPrinter, TestFunctionDecl2) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "void A() {}", "A", "void A()")); @@ -306,7 +304,7 @@ TEST(DeclPrinter, TestFunctionDecl2) { } TEST(DeclPrinter, TestFunctionDecl3) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "void Z();" "void A() { Z(); }", "A", @@ -315,7 +313,7 @@ TEST(DeclPrinter, TestFunctionDecl3) { } TEST(DeclPrinter, TestFunctionDecl4) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "extern void A();", "A", "extern void A()")); @@ -323,7 +321,7 @@ TEST(DeclPrinter, TestFunctionDecl4) { } TEST(DeclPrinter, TestFunctionDecl5) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "static void A();", "A", "static void A()")); @@ -331,7 +329,7 @@ TEST(DeclPrinter, TestFunctionDecl5) { } TEST(DeclPrinter, TestFunctionDecl6) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "inline void A();", "A", "inline void A()")); @@ -347,7 +345,7 @@ TEST(DeclPrinter, TestFunctionDecl7) { } TEST(DeclPrinter, TestFunctionDecl8) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "void A(int a);", "A", "void A(int a)")); @@ -355,7 +353,7 @@ TEST(DeclPrinter, TestFunctionDecl8) { } TEST(DeclPrinter, TestFunctionDecl9) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "void A(...);", "A", "void A(...)")); @@ -363,7 +361,7 @@ TEST(DeclPrinter, TestFunctionDecl9) { } TEST(DeclPrinter, TestFunctionDecl10) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "void A(int a, ...);", "A", "void A(int a, ...)")); @@ -371,7 +369,7 @@ TEST(DeclPrinter, TestFunctionDecl10) { } TEST(DeclPrinter, TestFunctionDecl11) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "typedef long size_t;" "typedef int *pInt;" "void A(int a, pInt b, size_t c);", @@ -381,7 +379,7 @@ TEST(DeclPrinter, TestFunctionDecl11) { } TEST(DeclPrinter, TestFunctionDecl12) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "void A(int a, int b = 0);", "A", "void A(int a, int b = 0)")); @@ -389,7 +387,7 @@ TEST(DeclPrinter, TestFunctionDecl12) { } TEST(DeclPrinter, TestFunctionDecl13) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "void (*A(int a))(int b);", "A", "void (*A(int a))(int)")); @@ -397,7 +395,7 @@ TEST(DeclPrinter, TestFunctionDecl13) { } TEST(DeclPrinter, TestFunctionDecl14) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "template" "void A(T t) { }" "template<>" @@ -409,7 +407,7 @@ TEST(DeclPrinter, TestFunctionDecl14) { TEST(DeclPrinter, TestCXXConstructorDecl1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct A {" " A();" "};", @@ -419,7 +417,7 @@ TEST(DeclPrinter, TestCXXConstructorDecl1) { } TEST(DeclPrinter, TestCXXConstructorDecl2) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct A {" " A(int a);" "};", @@ -429,7 +427,7 @@ TEST(DeclPrinter, TestCXXConstructorDecl2) { } TEST(DeclPrinter, TestCXXConstructorDecl3) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct A {" " A(const A &a);" "};", @@ -439,7 +437,7 @@ TEST(DeclPrinter, TestCXXConstructorDecl3) { } TEST(DeclPrinter, TestCXXConstructorDecl4) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct A {" " A(const A &a, int = 0);" "};", @@ -459,7 +457,7 @@ TEST(DeclPrinter, TestCXXConstructorDecl5) { } TEST(DeclPrinter, TestCXXConstructorDecl6) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct A {" " explicit A(int a);" "};", @@ -469,33 +467,30 @@ TEST(DeclPrinter, TestCXXConstructorDecl6) { } TEST(DeclPrinter, TestCXXConstructorDecl7) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX11Matches( "struct A {" " constexpr A();" "};", - ArrayRef("-std=c++11"), constructorDecl(ofClass(hasName("A"))).bind("id"), "")); // WRONG; Should be: "constexpr A();" } TEST(DeclPrinter, TestCXXConstructorDecl8) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX11Matches( "struct A {" " A() = default;" "};", - ArrayRef("-std=c++11"), constructorDecl(ofClass(hasName("A"))).bind("id"), "")); // WRONG; Should be: "A() = default;" } TEST(DeclPrinter, TestCXXConstructorDecl9) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX11Matches( "struct A {" " A() = delete;" "};", - ArrayRef("-std=c++11"), constructorDecl(ofClass(hasName("A"))).bind("id"), " = delete")); // WRONG; Should be: "A() = delete;" @@ -526,7 +521,7 @@ TEST(DeclPrinter, TestCXXConstructorDecl11) { #endif TEST(DeclPrinter, TestCXXDestructorDecl1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct A {" " ~A();" "};", @@ -536,7 +531,7 @@ TEST(DeclPrinter, TestCXXDestructorDecl1) { } TEST(DeclPrinter, TestCXXDestructorDecl2) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct A {" " virtual ~A();" "};", @@ -546,7 +541,7 @@ TEST(DeclPrinter, TestCXXDestructorDecl2) { } TEST(DeclPrinter, TestCXXConversionDecl1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct A {" " operator int();" "};", @@ -556,7 +551,7 @@ TEST(DeclPrinter, TestCXXConversionDecl1) { } TEST(DeclPrinter, TestCXXConversionDecl2) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct A {" " operator bool();" "};", @@ -566,7 +561,7 @@ TEST(DeclPrinter, TestCXXConversionDecl2) { } TEST(DeclPrinter, TestCXXConversionDecl3) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct Z {};" "struct A {" " operator Z();" @@ -577,42 +572,39 @@ TEST(DeclPrinter, TestCXXConversionDecl3) { } TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX11Matches( "namespace std { typedef decltype(sizeof(int)) size_t; }" "struct Z {" " void *operator new(std::size_t);" "};", - ArrayRef("-std=c++11"), methodDecl(ofClass(hasName("Z"))).bind("id"), "void *operator new(std::size_t)")); // Should be: with semicolon } TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction2) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX11Matches( "namespace std { typedef decltype(sizeof(int)) size_t; }" "struct Z {" " void *operator new[](std::size_t);" "};", - ArrayRef("-std=c++11"), methodDecl(ofClass(hasName("Z"))).bind("id"), "void *operator new[](std::size_t)")); // Should be: with semicolon } TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction3) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX11Matches( "struct Z {" " void operator delete(void *);" "};", - ArrayRef("-std=c++11"), methodDecl(ofClass(hasName("Z"))).bind("id"), "void operator delete(void *) noexcept")); // Should be: with semicolon, without noexcept? } TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction4) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct Z {" " void operator delete(void *);" "};", @@ -622,11 +614,10 @@ TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction4) { } TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction5) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX11Matches( "struct Z {" " void operator delete[](void *);" "};", - ArrayRef("-std=c++11"), methodDecl(ofClass(hasName("Z"))).bind("id"), "void operator delete[](void *) noexcept")); // Should be: with semicolon, without noexcept? @@ -653,7 +644,7 @@ TEST(DeclPrinter, TestCXXMethodDecl_Operator1) { Expected.append("(Z z)"); // Should be: with semicolon - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( Code, methodDecl(ofClass(hasName("Z"))).bind("id"), Expected)); @@ -677,7 +668,7 @@ TEST(DeclPrinter, TestCXXMethodDecl_Operator2) { Expected.append("()"); // Should be: with semicolon - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( Code, methodDecl(ofClass(hasName("Z"))).bind("id"), Expected)); @@ -685,7 +676,7 @@ TEST(DeclPrinter, TestCXXMethodDecl_Operator2) { } TEST(DeclPrinter, TestCXXMethodDecl1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct Z {" " void A(int a);" "};", @@ -695,7 +686,7 @@ TEST(DeclPrinter, TestCXXMethodDecl1) { } TEST(DeclPrinter, TestCXXMethodDecl2) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct Z {" " virtual void A(int a);" "};", @@ -705,7 +696,7 @@ TEST(DeclPrinter, TestCXXMethodDecl2) { } TEST(DeclPrinter, TestCXXMethodDecl3) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct Z {" " virtual void A(int a);" "};" @@ -719,7 +710,7 @@ TEST(DeclPrinter, TestCXXMethodDecl3) { } TEST(DeclPrinter, TestCXXMethodDecl4) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct Z {" " inline void A(int a);" "};", @@ -729,7 +720,7 @@ TEST(DeclPrinter, TestCXXMethodDecl4) { } TEST(DeclPrinter, TestCXXMethodDecl5) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct Z {" " virtual void A(int a) = 0;" "};", @@ -739,7 +730,7 @@ TEST(DeclPrinter, TestCXXMethodDecl5) { } TEST(DeclPrinter, TestCXXMethodDecl_CVQualifier1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct Z {" " void A(int a) const;" "};", @@ -749,7 +740,7 @@ TEST(DeclPrinter, TestCXXMethodDecl_CVQualifier1) { } TEST(DeclPrinter, TestCXXMethodDecl_CVQualifier2) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct Z {" " void A(int a) volatile;" "};", @@ -759,7 +750,7 @@ TEST(DeclPrinter, TestCXXMethodDecl_CVQualifier2) { } TEST(DeclPrinter, TestCXXMethodDecl_CVQualifier3) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct Z {" " void A(int a) const volatile;" "};", @@ -789,7 +780,7 @@ TEST(DeclPrinter, TestCXXMethodDecl_RefQualifier2) { } TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct Z {" " void A(int a) throw();" "};", @@ -799,7 +790,7 @@ TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification1) { } TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification2) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "struct Z {" " void A(int a) throw(int);" "};", @@ -809,7 +800,7 @@ TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification2) { } TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification3) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "class ZZ {};" "struct Z {" " void A(int a) throw(ZZ, int);" @@ -861,7 +852,7 @@ TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification7) { } TEST(DeclPrinter, TestVarDecl1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "char *const (*(*A)[5])(int);", "A", "char *const (*(*A)[5])(int)")); @@ -869,7 +860,7 @@ TEST(DeclPrinter, TestVarDecl1) { } TEST(DeclPrinter, TestVarDecl2) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "void (*A)() throw(int);", "A", "void (*A)() throw(int)")); @@ -885,7 +876,7 @@ TEST(DeclPrinter, TestVarDecl3) { } TEST(DeclPrinter, TestFieldDecl1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "template" "struct Z { T A; };", "A", @@ -894,7 +885,7 @@ TEST(DeclPrinter, TestFieldDecl1) { } TEST(DeclPrinter, TestFieldDecl2) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "template" "struct Z { int A[N]; };", "A", @@ -903,7 +894,7 @@ TEST(DeclPrinter, TestFieldDecl2) { } TEST(DeclPrinter, TestClassTemplateDecl1) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "template" "struct A { T a; };", classTemplateDecl(hasName("A")).bind("id"), @@ -912,7 +903,7 @@ TEST(DeclPrinter, TestClassTemplateDecl1) { } TEST(DeclPrinter, TestClassTemplateDecl2) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "template" "struct A { T a; };", classTemplateDecl(hasName("A")).bind("id"), @@ -921,7 +912,7 @@ TEST(DeclPrinter, TestClassTemplateDecl2) { } TEST(DeclPrinter, TestClassTemplateDecl3) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "template" "struct A { T a; };", classTemplateDecl(hasName("A")).bind("id"), @@ -930,7 +921,7 @@ TEST(DeclPrinter, TestClassTemplateDecl3) { } TEST(DeclPrinter, TestClassTemplateDecl4) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "template" "struct A { T a; U b; };", classTemplateDecl(hasName("A")).bind("id"), @@ -939,7 +930,7 @@ TEST(DeclPrinter, TestClassTemplateDecl4) { } TEST(DeclPrinter, TestClassTemplateDecl5) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "template" "struct A { int a[N]; };", classTemplateDecl(hasName("A")).bind("id"), @@ -948,7 +939,7 @@ TEST(DeclPrinter, TestClassTemplateDecl5) { } TEST(DeclPrinter, TestClassTemplateDecl6) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "template" "struct A { int a[N]; };", classTemplateDecl(hasName("A")).bind("id"), @@ -957,7 +948,7 @@ TEST(DeclPrinter, TestClassTemplateDecl6) { } TEST(DeclPrinter, TestClassTemplateDecl7) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "typedef int MyInt;" "template" "struct A { int a[N]; };", @@ -967,7 +958,7 @@ TEST(DeclPrinter, TestClassTemplateDecl7) { } TEST(DeclPrinter, TestClassTemplateDecl8) { - ASSERT_TRUE(PrintedDeclMatches( + ASSERT_TRUE(PrintedDeclCXX98Matches( "template class T> struct A { };", classTemplateDecl(hasName("A")).bind("id"), "template