Skip to content

Commit 7a7ad5e

Browse files
fix codegen to not cast func if templated
this is taken from cling
1 parent d9bf9ab commit 7a7ad5e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/CppInterOp/CppInterOp.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,8 +1987,9 @@ void make_narg_call(const FunctionDecl* FD, const std::string& return_type,
19871987
bool op_flag = !FD->isOverloadedOperator() ||
19881988
FD->getOverloadedOperator() == clang::OO_Call;
19891989

1990-
bool ShouldCastFunction =
1991-
!isa<CXXMethodDecl>(FD) && N == FD->getNumParams() && op_flag;
1990+
bool ShouldCastFunction = !isa<CXXMethodDecl>(FD) &&
1991+
N == FD->getNumParams() && op_flag &&
1992+
!FD->isTemplateInstantiation();
19921993
if (ShouldCastFunction) {
19931994
callbuf << "(";
19941995
callbuf << "(";

0 commit comments

Comments
 (0)