forked from OSchip/llvm-project
[AST] Add structural eq tests for template args
Summary: New tests added to verify equivalency of templates when their parameters are different. Reviewers: a_sidorin, shafik Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Differential Revision: https://reviews.llvm.org/D57235 llvm-svn: 352345
This commit is contained in:
parent
07b6d3de1b
commit
059c1d8e72
|
@ -802,6 +802,25 @@ TEST_F(StructuralEquivalenceEnumTest, EnumsWithDifferentBody) {
|
|||
EXPECT_FALSE(testStructuralMatch(t));
|
||||
}
|
||||
|
||||
struct StructuralEquivalenceTemplateTest : StructuralEquivalenceTest {};
|
||||
|
||||
TEST_F(StructuralEquivalenceTemplateTest, ExactlySameTemplates) {
|
||||
auto t = makeNamedDecls("template <class T> struct foo;",
|
||||
"template <class T> struct foo;", Lang_CXX);
|
||||
EXPECT_TRUE(testStructuralMatch(t));
|
||||
}
|
||||
|
||||
TEST_F(StructuralEquivalenceTemplateTest, DifferentTemplateArgName) {
|
||||
auto t = makeNamedDecls("template <class T> struct foo;",
|
||||
"template <class U> struct foo;", Lang_CXX);
|
||||
EXPECT_TRUE(testStructuralMatch(t));
|
||||
}
|
||||
|
||||
TEST_F(StructuralEquivalenceTemplateTest, DifferentTemplateArgKind) {
|
||||
auto t = makeNamedDecls("template <class T> struct foo;",
|
||||
"template <int T> struct foo;", Lang_CXX);
|
||||
EXPECT_FALSE(testStructuralMatch(t));
|
||||
}
|
||||
|
||||
} // end namespace ast_matchers
|
||||
} // end namespace clang
|
||||
|
|
Loading…
Reference in New Issue