summaryrefslogtreecommitdiff
path: root/clang/unittests/AST/TypePrinterTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/AST/TypePrinterTest.cpp')
-rw-r--r--clang/unittests/AST/TypePrinterTest.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/unittests/AST/TypePrinterTest.cpp b/clang/unittests/AST/TypePrinterTest.cpp
index 8500d518d25f..d60ecedea95f 100644
--- a/clang/unittests/AST/TypePrinterTest.cpp
+++ b/clang/unittests/AST/TypePrinterTest.cpp
@@ -64,6 +64,22 @@ TEST(TypePrinter, TemplateId) {
[](PrintingPolicy &Policy) { Policy.FullyQualifiedName = true; }));
}
+TEST(TypePrinter, TemplateId2) {
+ std::string Code = R"cpp(
+ template <template <typename ...> class TemplatedType>
+ void func(TemplatedType<int> Param);
+ )cpp";
+ auto Matcher = parmVarDecl(hasType(qualType().bind("id")));
+
+ // Regression test ensuring we do not segfault getting the QualType as a
+ // string.
+ ASSERT_TRUE(PrintedTypeMatches(Code, {}, Matcher, "<int>",
+ [](PrintingPolicy &Policy) {
+ Policy.FullyQualifiedName = true;
+ Policy.PrintCanonicalTypes = true;
+ }));
+}
+
TEST(TypePrinter, ParamsUglified) {
llvm::StringLiteral Code = R"cpp(
template <typename _Tp, template <typename> class __f>