We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 70f5880 commit 3bc0b4cCopy full SHA for 3bc0b4c
1 file changed
cpp2rust/converter/converter.cpp
@@ -1554,8 +1554,12 @@ Converter::CallInfo Converter::CollectCallInfo(clang::CallExpr *expr) {
1554
function ? function->getNumParams() : proto->getNumParams();
1555
info.is_variadic = function ? function->isVariadic() : proto->isVariadic();
1556
info.is_fn_ptr_call = !function;
1557
- info.is_libc_passthrough =
1558
- decl && ctx_.getSourceManager().isInSystemHeader(decl->getLocation());
+ info.is_libc_passthrough = false;
+ if (auto tgt_ir = Mapper::GetExprRule(GetCalleeOrExpr(expr))) {
1559
+ if (tgt_ir->body.empty() && tgt_ir->is_variadic) {
1560
+ info.is_libc_passthrough = true;
1561
+ }
1562
1563
1564
for (unsigned i = 0; i < num_named_params && i < num_args; ++i) {
1565
auto *arg = expr->getArg(i + arg_begin);
0 commit comments