Skip to content

Commit aaf2644

Browse files
committed
Uncomment error handling tests
1 parent 72b2433 commit aaf2644

File tree

4 files changed

+24
-29
lines changed

4 files changed

+24
-29
lines changed

test/Interop/Cxx/templates/Inputs/class-templates.h renamed to test/Interop/Cxx/templates/Inputs/class-template-instantiation-errors.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATES_H
2-
#define TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATES_H
1+
#ifndef TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_INSTANTIATION_ERRORS_H
2+
#define TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_INSTANTIATION_ERRORS_H
33

44
template<class T>
55
struct MagicWrapper {
@@ -19,4 +19,4 @@ struct CannotBeInstantianted {
1919
}
2020
};
2121

22-
#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATES_H
22+
#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_INSTANTIATION_ERRORS_H

test/Interop/Cxx/templates/Inputs/module.modulemap

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ module LinkageOfSwiftSymbolsForImportedTypes {
4242
header "linkage-of-swift-symbols-for-imported-types.h"
4343
}
4444

45-
module ClassTemplates {
46-
header "class-templates.h"
45+
module ClassTemplateInstantiationErrors {
46+
header "class-template-instantiation-errors.h"
4747
}
4848

4949
module ClassTemplateVariadic {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: not %target-swift-emit-sil %s -I %S/Inputs -enable-cxx-interop 2>&1 | %FileCheck %s
2+
3+
import ClassTemplateInstantiationErrors
4+
import StdlibUnittest
5+
6+
var TemplatesTestSuite = TestSuite("TemplatesTestSuite")
7+
8+
// CHECK: class-instantiation-error-handling.swift:10:18: error: only C++ types supported
9+
TemplatesTestSuite.test("swift-template-arg-not-supported") {
10+
var magicInt = MagicWrapper<String>(t: "asdf")
11+
}
12+
13+
// CHECK: class-template-instantiation-errors.h:18:7: error: no member named 'doesNotExist' in 'IntWrapper'
14+
// CHECK: class-template-instantiation-errors.h:16:8: note: in instantiation of member function 'CannotBeInstantianted<IntWrapper>::willFailInstantiating' requested here
15+
TemplatesTestSuite.test("clang-errors-reported-on-instantiation") {
16+
var _ = CannotBeInstantianted<IntWrapper>()
17+
}
18+
19+
runAllTests()

test/Interop/Cxx/templates/class-instantiation.swift

-24
This file was deleted.

0 commit comments

Comments
 (0)