interrogate: envelop function calls in parentheses

This reduces the risk of calling a preprocessor macro instead of a method.
This commit is contained in:
rdb 2019-10-07 21:46:37 +02:00
parent fb5440bd07
commit 3c9591cfbf
1 changed files with 4 additions and 3 deletions

View File

@ -445,15 +445,16 @@ get_call_str(const string &container, const vector_string &pexprs) const {
} else if (_has_this && !container.empty()) {
// If we have a "this" parameter, the calling convention is also a bit
// different.
call << "(";
call << "((";
_parameters[0]._remap->pass_parameter(call, container);
call << ")." << _cppfunc->get_local_name();
call << ")." << _cppfunc->get_local_name() << ")";
} else {
call << "(";
if (_cpptype != nullptr) {
call << _cpptype->get_local_name(&parser);
}
call << "::" << _cppfunc->get_local_name();
call << "::" << _cppfunc->get_local_name() << ")";
}
}
call << "(";