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
5 changes: 5 additions & 0 deletions lib/ClangImporter/ImportDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4638,6 +4638,11 @@ namespace {
return result;
}

Decl *VisitVarTemplatePartialSpecializationDecl(
const clang::VarTemplatePartialSpecializationDecl *decl) {
return nullptr;
}

Decl *VisitImplicitParamDecl(const clang::ImplicitParamDecl *decl) {
// Parameters are never directly imported.
return nullptr;
Expand Down
3 changes: 0 additions & 3 deletions test/ClangImporter/const_values_cxx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ func foo() {

print(MyClass().class_const_int)
print(MyClass.class_static_const_int)

// TODO: This seems to be incorrectly imported, this test here is just to check that the compiler doesn't crash.
print(template_gcd)
}

// Only imported as external declarations:
Expand Down
5 changes: 5 additions & 0 deletions test/Interop/Cxx/templates/Inputs/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,8 @@ module UninstantiatableSpecialMembers {
header "uninstantiatable-special-members.h"
requires cplusplus
}

module VariableTemplate {
header "variable-template.h"
requires cplusplus
}
5 changes: 5 additions & 0 deletions test/Interop/Cxx/templates/Inputs/variable-template.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
template <int N, int M>
inline const int template_gcd = template_gcd<M, N % M>;

template <int N>
inline const int template_gcd<N, 0> = N;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// RUN: %target-typecheck-verify-swift -cxx-interoperability-mode=default -I %S/Inputs

import VariableTemplate

let _: CInt = template_gcd // expected-error {{cannot find 'template_gcd' in scope}}