diff --git a/lib/ClangImporter/ClangClassTemplateNamePrinter.cpp b/lib/ClangImporter/ClangClassTemplateNamePrinter.cpp index 710ccbdf3f9da..dbdbadec83101 100644 --- a/lib/ClangImporter/ClangClassTemplateNamePrinter.cpp +++ b/lib/ClangImporter/ClangClassTemplateNamePrinter.cpp @@ -38,6 +38,8 @@ struct TemplateInstantiationNamePrinter switch (type->getKind()) { case clang::BuiltinType::Void: return "Void"; + case clang::BuiltinType::NullPtr: + return "nil"; #define MAP_BUILTIN_TYPE(CLANG_BUILTIN_KIND, SWIFT_TYPE_NAME) \ case clang::BuiltinType::CLANG_BUILTIN_KIND: \ diff --git a/test/Interop/Cxx/templates/Inputs/class-template-with-primitive-argument.h b/test/Interop/Cxx/templates/Inputs/class-template-with-primitive-argument.h index 38f9a4538fcd8..45fca4dddfd15 100644 --- a/test/Interop/Cxx/templates/Inputs/class-template-with-primitive-argument.h +++ b/test/Interop/Cxx/templates/Inputs/class-template-with-primitive-argument.h @@ -1,6 +1,8 @@ #ifndef TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_WITH_PRIMITIVE_ARGUMENT_H #define TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_WITH_PRIMITIVE_ARGUMENT_H +#include + template struct MagicWrapper { T t; @@ -23,6 +25,7 @@ typedef MagicWrapper WrappedMagicIntArr; typedef MagicWrapper WrappedMagicLongArr; typedef MagicWrapper WrappedMagicIntFixedSizeArr1; typedef MagicWrapper WrappedMagicIntFixedSizeArr2; +typedef MagicWrapper WrappedMagicNullPtr; typedef DoubleWrapper> DoubleWrappedInt; typedef DoubleWrapper> DoubleWrappedIntConst; @@ -33,5 +36,6 @@ typedef DoubleWrapper> DoubleWrappedMagicIntArr; typedef DoubleWrapper> DoubleWrappedMagicLongArr; typedef DoubleWrapper> DoubleWrappedMagicIntFixedSizeArr1; typedef DoubleWrapper> DoubleWrappedMagicIntFixedSizeArr2; +typedef DoubleWrapper> DoubleWrappedMagicNullPtr; #endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_WITH_PRIMITIVE_ARGUMENT_H diff --git a/test/Interop/Cxx/templates/class-template-with-primitive-argument-module-interface.swift b/test/Interop/Cxx/templates/class-template-with-primitive-argument-module-interface.swift index 9e03c56c4ce8b..1d8a4125f97f3 100644 --- a/test/Interop/Cxx/templates/class-template-with-primitive-argument-module-interface.swift +++ b/test/Interop/Cxx/templates/class-template-with-primitive-argument-module-interface.swift @@ -17,6 +17,7 @@ // CHECK: typealias WrappedMagicLongArr = MagicWrapper<[CLong]> // CHECK: typealias WrappedMagicIntFixedSizeArr1 = MagicWrapper> // CHECK: typealias WrappedMagicIntFixedSizeArr2 = MagicWrapper> +// CHECK: typealias WrappedMagicNullPtr = MagicWrapper // CHECK: typealias DoubleWrappedInt = DoubleWrapper> // CHECK: typealias DoubleWrappedIntConst = DoubleWrapper> @@ -27,3 +28,4 @@ // CHECK: typealias DoubleWrappedMagicLongArr = DoubleWrapper> // CHECK: typealias DoubleWrappedMagicIntFixedSizeArr1 = DoubleWrapper>> // CHECK: typealias DoubleWrappedMagicIntFixedSizeArr2 = DoubleWrapper>> +// CHECK: typealias DoubleWrappedMagicNullPtr = DoubleWrapper>