Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/ClangImporter/ClangClassTemplateNamePrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: \
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <cstddef>

template<class T>
struct MagicWrapper {
T t;
Expand All @@ -23,6 +25,7 @@ typedef MagicWrapper<int[]> WrappedMagicIntArr;
typedef MagicWrapper<long[]> WrappedMagicLongArr;
typedef MagicWrapper<int[123]> WrappedMagicIntFixedSizeArr1;
typedef MagicWrapper<int[124]> WrappedMagicIntFixedSizeArr2;
typedef MagicWrapper<std::nullptr_t> WrappedMagicNullPtr;

typedef DoubleWrapper<MagicWrapper<int>> DoubleWrappedInt;
typedef DoubleWrapper<MagicWrapper<const int>> DoubleWrappedIntConst;
Expand All @@ -33,5 +36,6 @@ typedef DoubleWrapper<MagicWrapper<int[]>> DoubleWrappedMagicIntArr;
typedef DoubleWrapper<MagicWrapper<long[]>> DoubleWrappedMagicLongArr;
typedef DoubleWrapper<MagicWrapper<int[42]>> DoubleWrappedMagicIntFixedSizeArr1;
typedef DoubleWrapper<MagicWrapper<int[43]>> DoubleWrappedMagicIntFixedSizeArr2;
typedef DoubleWrapper<MagicWrapper<std::nullptr_t>> DoubleWrappedMagicNullPtr;

#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_WITH_PRIMITIVE_ARGUMENT_H
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// CHECK: typealias WrappedMagicLongArr = MagicWrapper<[CLong]>
// CHECK: typealias WrappedMagicIntFixedSizeArr1 = MagicWrapper<Vector<CInt, 123>>
// CHECK: typealias WrappedMagicIntFixedSizeArr2 = MagicWrapper<Vector<CInt, 124>>
// CHECK: typealias WrappedMagicNullPtr = MagicWrapper<nil>

// CHECK: typealias DoubleWrappedInt = DoubleWrapper<MagicWrapper<CInt>>
// CHECK: typealias DoubleWrappedIntConst = DoubleWrapper<MagicWrapper<CInt_const>>
Expand All @@ -27,3 +28,4 @@
// CHECK: typealias DoubleWrappedMagicLongArr = DoubleWrapper<MagicWrapper<[CLong]>>
// CHECK: typealias DoubleWrappedMagicIntFixedSizeArr1 = DoubleWrapper<MagicWrapper<Vector<CInt, 42>>>
// CHECK: typealias DoubleWrappedMagicIntFixedSizeArr2 = DoubleWrapper<MagicWrapper<Vector<CInt, 43>>>
// CHECK: typealias DoubleWrappedMagicNullPtr = DoubleWrapper<MagicWrapper<nil>>