Lines Matching defs:t
171 testStructuralMatch(std::tuple<StmtWithASTContext, StmtWithASTContext> t) {
172 return testStructuralMatch(get<0>(t), get<1>(t));
175 bool testStructuralMatch(std::tuple<Decl *, Decl *> t,
177 return testStructuralMatch(get<0>(t), get<1>(t), IgnoreTemplateParmDepth);
304 auto t = makeNamedDecls("void foo();", "template<class T> void foo();",
306 EXPECT_FALSE(testStructuralMatch(t));
310 auto t = makeDecls<FunctionDecl>(
314 EXPECT_FALSE(testStructuralMatch(t));
318 auto t = makeDecls<FunctionDecl>(
322 EXPECT_TRUE(testStructuralMatch(t));
326 auto t = makeDecls<FunctionDecl>("struct X{ X(); };", "struct X{ ~X(); };",
329 EXPECT_FALSE(testStructuralMatch(t));
333 auto t =
335 EXPECT_FALSE(testStructuralMatch(t));
339 auto t = makeNamedDecls("void foo(int);", "void foo(const int);", Lang_CXX03);
340 EXPECT_TRUE(testStructuralMatch(t));
345 auto t = makeNamedDecls("void foo();", "void foo() throw();", Lang_CXX03);
346 EXPECT_FALSE(testStructuralMatch(t));
350 auto t = makeNamedDecls("void foo();",
352 EXPECT_FALSE(testStructuralMatch(t));
356 auto t = makeNamedDecls("void foo() throw();",
358 EXPECT_FALSE(testStructuralMatch(t));
362 auto t = makeNamedDecls("void foo() throw();",
364 EXPECT_FALSE(testStructuralMatch(t));
368 auto t = makeNamedDecls("void foo() throw();",
370 EXPECT_FALSE(testStructuralMatch(t));
374 auto t = makeNamedDecls("void foo() noexcept(false);",
376 EXPECT_FALSE(testStructuralMatch(t));
380 auto t = makeNamedDecls("void foo() noexcept(false);",
382 EXPECT_TRUE(testStructuralMatch(t));
386 auto t = makeNamedDecls("void foo() noexcept;",
388 EXPECT_FALSE(testStructuralMatch(t));
392 auto t = makeNamedDecls("void foo() noexcept;",
394 EXPECT_FALSE(testStructuralMatch(t));
398 auto t = makeNamedDecls("char foo();", "int foo();", Lang_CXX03);
399 EXPECT_FALSE(testStructuralMatch(t));
403 auto t = makeNamedDecls("char foo();", "const char foo();", Lang_CXX03);
404 EXPECT_FALSE(testStructuralMatch(t));
408 auto t = makeNamedDecls("char &foo();",
410 EXPECT_FALSE(testStructuralMatch(t));
414 auto t = makeNamedDecls("void foo(int);", "void foo(int, int);", Lang_CXX03);
415 EXPECT_FALSE(testStructuralMatch(t));
419 auto t = makeNamedDecls("void foo(int);", "void foo(char);", Lang_CXX03);
420 EXPECT_FALSE(testStructuralMatch(t));
424 auto t = makeNamedDecls("void foo(int a);", "void foo(int b);", Lang_CXX03);
425 EXPECT_TRUE(testStructuralMatch(t));
429 auto t =
431 EXPECT_FALSE(testStructuralMatch(t));
435 auto t = makeNamedDecls("void foo(int *);", "void foo(int);", Lang_CXX03);
436 EXPECT_FALSE(testStructuralMatch(t));
440 auto t = makeNamedDecls("void ((foo))();", "void foo();", Lang_CXX03);
441 EXPECT_TRUE(testStructuralMatch(t));
445 auto t = makeNamedDecls(
449 EXPECT_FALSE(testStructuralMatch(t));
453 auto t = makeNamedDecls(
457 EXPECT_FALSE(testStructuralMatch(t));
461 auto t = makeNamedDecls("__attribute__((noreturn)) void foo();",
463 EXPECT_TRUE(testStructuralMatch(t));
472 auto t = makeNamedDecls("__attribute__((preserve_all)) void foo();",
474 EXPECT_FALSE(testStructuralMatch(t));
481 auto t = makeNamedDecls(
484 EXPECT_FALSE(testStructuralMatch(t));
491 auto t = makeDecls<CXXMethodDecl>("struct X { void foo(); };",
494 EXPECT_FALSE(testStructuralMatch(t));
498 auto t = makeNamedDecls("struct X { virtual void foo(); };",
500 EXPECT_FALSE(testStructuralMatch(t));
505 auto t =
508 EXPECT_FALSE(testStructuralMatch(t));
512 auto t = makeNamedDecls("struct X { void foo(); };",
514 EXPECT_FALSE(testStructuralMatch(t));
518 auto t = makeNamedDecls("struct X { void foo(); };",
520 EXPECT_FALSE(testStructuralMatch(t));
524 auto t = makeNamedDecls("struct X { void foo(); };",
526 EXPECT_FALSE(testStructuralMatch(t));
530 auto t = makeNamedDecls("struct X { void foo() &; };",
532 EXPECT_FALSE(testStructuralMatch(t));
536 auto t = makeDecls<CXXMethodDecl>("struct X { public: void foo(); };",
539 EXPECT_FALSE(testStructuralMatch(t));
543 auto t = makeNamedDecls("struct X { void foo(); };",
545 EXPECT_FALSE(testStructuralMatch(t));
549 auto t = makeDecls<FunctionDecl>("void foo();", "struct foo { foo(); };",
552 EXPECT_FALSE(testStructuralMatch(t));
556 auto t = makeDecls<CXXConstructorDecl>("struct X { X(); };",
559 EXPECT_FALSE(testStructuralMatch(t));
563 auto t = makeDecls<CXXConstructorDecl>("struct X { X(int); };",
567 EXPECT_FALSE(testStructuralMatch(t));
571 auto t = makeDecls<CXXConstructorDecl>("struct X { X(); };",
575 EXPECT_FALSE(testStructuralMatch(t));
579 auto t = makeDecls<CXXConversionDecl>("struct X { operator bool(); };",
583 EXPECT_FALSE(testStructuralMatch(t));
587 auto t =
592 EXPECT_FALSE(testStructuralMatch(t));
596 auto t = makeDecls<FunctionDecl>(
600 EXPECT_TRUE(testStructuralMatch(t));
604 auto t = makeDecls<FunctionDecl>(
608 EXPECT_FALSE(testStructuralMatch(t));
620 auto t = makeDecls<CXXRecordDecl>("struct A{ };", "struct B{ };", Lang_CXX03,
623 EXPECT_FALSE(testStructuralMatch(t));
627 auto t = makeNamedDecls("struct foo{ int x; };", "struct foo{ char x; };",
629 EXPECT_FALSE(testStructuralMatch(t));
634 auto t = makeNamedDecls("struct foo{ int x(); };", "struct foo{ char x(); };",
636 EXPECT_FALSE(testStructuralMatch(t));
640 auto t = makeNamedDecls("struct A{ }; struct foo: A { };",
642 EXPECT_FALSE(testStructuralMatch(t));
646 auto t =
649 EXPECT_FALSE(testStructuralMatch(t));
654 auto t =
657 EXPECT_FALSE(testStructuralMatch(t));
669 auto t = makeNamedDecls(Code, Code, Lang_CXX03);
670 EXPECT_TRUE(testStructuralMatch(t));
674 auto t = makeTuDecls(
686 auto *TU = get<0>(t);
701 auto t = makeTuDecls(
713 auto *TU = get<0>(t);
731 auto t = makeTuDecls(
746 auto *TU = get<0>(t);
752 auto *TU1 = get<1>(t);
784 auto t = makeTuDecls(Code, Code, Lang_C99);
786 auto *FromTU = get<0>(t);
790 auto *ToTU = get<1>(t);
808 auto t = makeDecls<CXXRecordDecl>("struct A { };",
811 EXPECT_FALSE(testStructuralMatch(t));
816 auto t = makeNamedDecls("class foo;", "class foo;", Lang_CXX11);
817 EXPECT_TRUE(testStructuralMatch(t));
822 auto t =
824 EXPECT_TRUE(testStructuralMatch(t));
829 auto t = makeNamedDecls("class foo { int A; };", "class foo { int A; };",
831 EXPECT_TRUE(testStructuralMatch(t));
835 auto t = makeNamedDecls("class foo { int B; };", "class foo { int A; };",
837 EXPECT_FALSE(testStructuralMatch(t));
841 auto t = makeNamedDecls("struct foo { friend class X; };",
844 EXPECT_FALSE(testStructuralMatch(t));
848 auto t = makeNamedDecls("struct foo { friend class X; friend class Y; };",
851 EXPECT_FALSE(testStructuralMatch(t));
855 auto t = makeNamedDecls("struct foo { friend class X; friend class Y; };",
858 EXPECT_TRUE(testStructuralMatch(t));
864 // Get the LambdaExprs, unfortunately we can't match directly the underlying
866 auto t = makeDecls<LambdaExpr>(
872 CXXRecordDecl *L0 = get<0>(t)->getLambdaClass();
873 CXXRecordDecl *L1 = get<1>(t)->getLambdaClass();
878 auto t = makeDecls<LambdaExpr>(
884 CXXRecordDecl *L0 = get<0>(t)->getLambdaClass();
885 CXXRecordDecl *L1 = get<1>(t)->getLambdaClass();
890 auto t = makeDecls<LambdaExpr>(
896 CXXRecordDecl *L0 = get<0>(t)->getLambdaClass();
897 CXXRecordDecl *L1 = get<1>(t)->getLambdaClass();
902 auto t = makeDecls<LambdaExpr>(
908 CXXRecordDecl *L0 = get<0>(t)->getLambdaClass();
909 CXXRecordDecl *L1 = get<1>(t)->getLambdaClass();
914 auto t = makeNamedDecls("struct A{ }; struct B{ }; void foo(A a, A b);",
917 EXPECT_FALSE(testStructuralMatch(t));
1035 auto t = makeDecls<VarDecl>(Code + R"(
1047 EXPECT_FALSE(testStructuralMatch(t));
1088 auto t = makeNamedDecls("enum class foo;", "enum class foo;", Lang_CXX11);
1089 EXPECT_TRUE(testStructuralMatch(t));
1094 auto t =
1096 EXPECT_TRUE(testStructuralMatch(t));
1101 auto t = makeNamedDecls("enum class foo { A };", "enum class foo { A };",
1103 EXPECT_TRUE(testStructuralMatch(t));
1107 auto t = makeNamedDecls("enum class foo { B };", "enum class foo { A };",
1109 EXPECT_FALSE(testStructuralMatch(t));
1114 auto t = makeNamedDecls("struct foo { enum { A } x; };",
1116 EXPECT_TRUE(testStructuralMatch(t));
1121 auto t = makeNamedDecls("struct foo { enum { A } x; };",
1123 EXPECT_FALSE(testStructuralMatch(t));
1129 auto t = makeNamedDecls("enum foo { foo = 1 };", "enum foo { foo = 1 };",
1131 EXPECT_TRUE(testStructuralMatch(t));
1136 auto t =
1138 EXPECT_FALSE(testStructuralMatch(t));
1143 auto t = makeNamedDecls("enum e { foo = 1 + 1 };", "enum e { foo = 2 };",
1145 EXPECT_FALSE(testStructuralMatch(t));
1150 auto t = makeNamedDecls("enum e : unsigned { foo = 1 };",
1152 EXPECT_FALSE(testStructuralMatch(t));
1156 auto t = makeNamedDecls("enum e : short { foo = 1 };",
1158 EXPECT_FALSE(testStructuralMatch(t));
1162 auto t =
1165 EXPECT_FALSE(testStructuralMatch(t));
1171 auto t = makeDecls<ObjCCategoryDecl>("@interface A @end @interface A(X) @end",
1174 EXPECT_TRUE(testStructuralMatch(t));
1178 auto t = makeDecls<ObjCCategoryDecl>("@interface A @end @interface A(X) @end",
1181 EXPECT_FALSE(testStructuralMatch(t));
1185 auto t = makeDecls<ObjCCategoryDecl>("@interface A @end @interface A(X) @end",
1188 EXPECT_FALSE(testStructuralMatch(t));
1192 auto t = makeDecls<ObjCCategoryDecl>(" @interface A(X) @end",
1195 EXPECT_FALSE(testStructuralMatch(t));
1204 auto t = makeDecls<ObjCCategoryDecl>("@interface A @end @interface A(X) @end",
1207 EXPECT_FALSE(testStructuralMatch(t));
1211 auto t = makeDecls<ObjCCategoryDecl>(
1215 EXPECT_TRUE(testStructuralMatch(t));
1219 auto t = makeDecls<ObjCCategoryDecl>(
1223 EXPECT_FALSE(testStructuralMatch(t));
1227 auto t = makeDecls<ObjCCategoryDecl>(
1233 EXPECT_FALSE(testStructuralMatch(t));
1237 auto t = makeDecls<ObjCCategoryDecl>(
1241 EXPECT_TRUE(testStructuralMatch(t));
1245 auto t = makeDecls<ObjCCategoryDecl>(
1249 EXPECT_FALSE(testStructuralMatch(t));
1253 auto t = makeDecls<ObjCCategoryDecl>(
1257 EXPECT_FALSE(testStructuralMatch(t));
1261 auto t = makeDecls<ObjCCategoryDecl>(
1265 EXPECT_FALSE(testStructuralMatch(t));
1269 auto t = makeDecls<ObjCCategoryDecl>(
1273 EXPECT_FALSE(testStructuralMatch(t));
1277 auto t = makeDecls<ObjCCategoryDecl>(
1281 EXPECT_FALSE(testStructuralMatch(t));
1285 auto t = makeDecls<ObjCCategoryDecl>(
1289 EXPECT_FALSE(testStructuralMatch(t));
1293 auto t = makeDecls<ObjCCategoryDecl>(
1297 EXPECT_TRUE(testStructuralMatch(t));
1301 auto t = makeDecls<ObjCCategoryDecl>(
1305 EXPECT_FALSE(testStructuralMatch(t));
1315 auto t = makeDecls<ObjCCategoryDecl>(
1319 EXPECT_FALSE(testStructuralMatch(t));
1323 auto t = makeDecls<ObjCCategoryDecl>(
1327 EXPECT_FALSE(testStructuralMatch(t));
1331 auto t = makeDecls<ObjCCategoryDecl>(
1335 EXPECT_FALSE(testStructuralMatch(t));
1339 auto t = makeDecls<ObjCCategoryDecl>(
1343 EXPECT_TRUE(testStructuralMatch(t));
1347 auto t = makeDecls<ObjCCategoryDecl>(
1350 EXPECT_FALSE(testStructuralMatch(t));
1354 auto t = makeDecls<ObjCCategoryDecl>(
1358 EXPECT_FALSE(testStructuralMatch(t));
1364 auto t = makeNamedDecls("template <class T> struct foo;",
1366 EXPECT_TRUE(testStructuralMatch(t));
1370 auto t = makeNamedDecls("template <class T> struct foo;",
1372 EXPECT_TRUE(testStructuralMatch(t));
1376 auto t = makeNamedDecls("template <class T> struct foo;",
1378 EXPECT_FALSE(testStructuralMatch(t));
1383 auto t = makeNamedDecls(Code, Code, Lang_CXX03);
1384 EXPECT_TRUE(testStructuralMatch(t));
1388 auto t = makeNamedDecls("class foo { int a : 2; };",
1390 EXPECT_FALSE(testStructuralMatch(t));
1395 auto t = makeNamedDecls(Code, Code, Lang_CXX03);
1396 EXPECT_TRUE(testStructuralMatch(t));
1400 auto t = makeNamedDecls(
1404 EXPECT_FALSE(testStructuralMatch(t));
1408 auto t = makeNamedDecls(
1411 EXPECT_FALSE(testStructuralMatch(t));
1438 auto t = makeDecls<ClassTemplateSpecializationDecl>(
1463 EXPECT_TRUE(testStructuralMatch(t));
1468 auto t = makeDecls<ClassTemplateSpecializationDecl>(
1494 EXPECT_FALSE(testStructuralMatch(t));
1516 auto t = makeDecls<FunctionTemplateDecl>(Code, Code, Lang_CXX11,
1518 EXPECT_TRUE(testStructuralMatch(t));
1534 auto t = makeDecls<FunctionTemplateDecl>(Code + R"(
1550 EXPECT_FALSE(testStructuralMatch(t));
1569 auto t = makeDecls<FunctionTemplateDecl>(Code, Code, Lang_CXX11,
1571 EXPECT_TRUE(testStructuralMatch(t));
1587 auto t = makeDecls<FunctionTemplateDecl>(Code + R"(
1603 EXPECT_FALSE(testStructuralMatch(t));
1616 auto t = makeDecls<FunctionTemplateDecl>(Code + R"(
1632 EXPECT_FALSE(testStructuralMatch(t));
1638 auto t = makeDecls<ClassTemplateSpecializationDecl>(
1657 EXPECT_TRUE(testStructuralMatch(t));
1663 auto t = makeDecls<ClassTemplateSpecializationDecl>(
1683 EXPECT_FALSE(testStructuralMatch(t));
1689 auto t = makeDecls<ClassTemplateSpecializationDecl>(
1708 EXPECT_TRUE(testStructuralMatch(t));
1714 auto t = makeDecls<ClassTemplateSpecializationDecl>(
1734 EXPECT_FALSE(testStructuralMatch(t));
1774 auto t = makeDecls<ClassTemplateSpecializationDecl>(
1792 EXPECT_FALSE(testStructuralMatch(t));
2099 auto t = makeWrappedStmts("lbl: &&lbl;", "lbl: &&lbl;", Lang_CXX03,
2101 EXPECT_TRUE(testStructuralMatch(t));
2105 auto t = makeWrappedStmts("lbl1: lbl2: &&lbl1;", "lbl1: lbl2: &&lbl2;",
2108 EXPECT_TRUE(testStructuralMatch(t));
2124 auto t = makeStmts(
2130 EXPECT_TRUE(testStructuralMatch(t));
2135 auto t = makeStmts(
2141 EXPECT_FALSE(testStructuralMatch(t));
2145 auto t = makeWrappedStmts("1 + 1", "1 + 1", Lang_CXX03, binaryOperator());
2146 EXPECT_TRUE(testStructuralMatch(t));
2150 auto t = makeWrappedStmts("1 + 1", "1 - 1", Lang_CXX03, binaryOperator());
2151 EXPECT_FALSE(testStructuralMatch(t));
2156 auto t = makeStmts(Src, Src, Lang_CXX03, callExpr());
2157 EXPECT_TRUE(testStructuralMatch(t));
2162 auto t = makeStmts(FunctionSrc + "void wrapper() { func1(); }",
2165 EXPECT_FALSE(testStructuralMatch(t));
2169 auto t = makeWrappedStmts("'a'", "'a'", Lang_CXX03, characterLiteral());
2170 EXPECT_TRUE(testStructuralMatch(t));
2174 auto t = makeWrappedStmts("'a'", "'b'", Lang_CXX03, characterLiteral());
2175 EXPECT_FALSE(testStructuralMatch(t));
2179 auto t = makeWrappedStmts("__is_lvalue_expr(1)", "__is_lvalue_expr(1)",
2181 EXPECT_TRUE(testStructuralMatch(t));
2185 auto t = makeWrappedStmts("__is_lvalue_expr(1)", "__is_rvalue_expr(1)",
2187 EXPECT_FALSE(testStructuralMatch(t));
2191 auto t = makeWrappedStmts("1.0", "1.0", Lang_CXX03, fallbackExprMatcher());
2192 EXPECT_TRUE(testStructuralMatch(t));
2196 auto t = makeWrappedStmts("0x10.1p0", "16.0625", Lang_CXX17,
2199 EXPECT_TRUE(testStructuralMatch(t));
2203 auto t = makeWrappedStmts("1.0", "1.0f", Lang_CXX03, fallbackExprMatcher());
2204 EXPECT_FALSE(testStructuralMatch(t));
2208 auto t = makeWrappedStmts("1.01", "1.0", Lang_CXX03, fallbackExprMatcher());
2209 EXPECT_FALSE(testStructuralMatch(t));
2213 auto t = makeWrappedStmts("_Generic(0u, unsigned int: 0, float: 1)",
2216 EXPECT_TRUE(testStructuralMatch(t));
2220 auto t = makeWrappedStmts("_Generic(0u, unsigned int: 0, float: 1)",
2223 EXPECT_FALSE(testStructuralMatch(t));
2227 auto t = makeWrappedStmts("_Generic(0u, unsigned int: 0, float: 1)",
2230 EXPECT_FALSE(testStructuralMatch(t));
2234 auto t = makeStmts(
2252 EXPECT_TRUE(testStructuralMatch(t));
2257 auto t = makeStmts(
2276 EXPECT_FALSE(testStructuralMatch(t));
2279 auto t = makeWrappedStmts("1", "1", Lang_CXX03, integerLiteral());
2280 EXPECT_TRUE(testStructuralMatch(t));
2284 auto t = makeWrappedStmts("1", "0x1", Lang_CXX03, integerLiteral());
2286 EXPECT_TRUE(testStructuralMatch(t));
2290 auto t = makeWrappedStmts("1", "2", Lang_CXX03, integerLiteral());
2291 EXPECT_FALSE(testStructuralMatch(t));
2295 auto t = makeWrappedStmts("1", "1L", Lang_CXX03, integerLiteral());
2296 EXPECT_FALSE(testStructuralMatch(t));
2301 auto t = makeStmts(ClassSrc + "int wrapper() { C c; return c.a; }",
2304 EXPECT_TRUE(testStructuralMatch(t));
2309 auto t = makeStmts(ClassSrc + "int wrapper() { C c; return c.a; }",
2312 EXPECT_FALSE(testStructuralMatch(t));
2316 auto t =
2318 EXPECT_TRUE(testStructuralMatch(t));
2322 auto t =
2324 EXPECT_FALSE(testStructuralMatch(t));
2328 auto t = makeWrappedStmts("\"a\"", "\"a\"", Lang_CXX03, stringLiteral());
2329 EXPECT_TRUE(testStructuralMatch(t));
2333 auto t = makeWrappedStmts("\"a\"", "\"b\"", Lang_CXX03, stringLiteral());
2334 EXPECT_FALSE(testStructuralMatch(t));
2338 auto t = makeWrappedStmts("\"a\"", "\"aa\"", Lang_CXX03, stringLiteral());
2339 EXPECT_FALSE(testStructuralMatch(t));
2343 auto t = makeWrappedStmts("__is_pod(int)", "__is_pod(int)", Lang_CXX03,
2345 EXPECT_TRUE(testStructuralMatch(t));
2349 auto t = makeWrappedStmts("__is_pod(int)", "__is_pod(long)", Lang_CXX03,
2351 EXPECT_FALSE(testStructuralMatch(t));
2355 auto t = makeWrappedStmts(
2357 EXPECT_FALSE(testStructuralMatch(t));
2361 auto t = makeWrappedStmts("__is_constructible(int)",
2363 EXPECT_FALSE(testStructuralMatch(t));
2367 auto t = makeWrappedStmts("sizeof(int)", "sizeof(int)", Lang_CXX03,
2369 EXPECT_TRUE(testStructuralMatch(t));
2373 auto t = makeWrappedStmts("sizeof(int)", "alignof(long)", Lang_CXX11,
2375 EXPECT_FALSE(testStructuralMatch(t));
2379 auto t = makeWrappedStmts("sizeof(int)", "sizeof(long)", Lang_CXX03,
2381 EXPECT_FALSE(testStructuralMatch(t));
2385 auto t = makeWrappedStmts("+1", "+1", Lang_CXX03, unaryOperator());
2386 EXPECT_TRUE(testStructuralMatch(t));
2390 auto t = makeWrappedStmts("+1", "-1", Lang_CXX03, unaryOperator());
2391 EXPECT_FALSE(testStructuralMatch(t));
2396 auto t = makeNamedDecls(
2515 EXPECT_TRUE(testStructuralMatch(t));
2520 auto t = makeNamedDecls(
2542 EXPECT_FALSE(testStructuralMatch(t));
2546 auto t = makeNamedDecls(
2560 EXPECT_FALSE(testStructuralMatch(t));
2564 auto t = makeStmts(
2568 void f(T t) {
2569 f1(t);
2576 void f(T t) {
2577 f2(t);
2582 EXPECT_FALSE(testStructuralMatch(t));
2586 auto t = makeStmts(
2594 void f(T t) {
2595 X::g(t);
2607 void f(T t) {
2608 Y::g(t);
2614 EXPECT_FALSE(testStructuralMatch(t));
2619 auto t = makeStmts(
2645 EXPECT_FALSE(testStructuralMatch(t));
2649 auto t = makeStmts(
2683 EXPECT_TRUE(testStructuralMatch(t));
2706 auto t = makeStmts(
2710 EXPECT_FALSE(testStructuralMatch(t));