Skip to content

Commit 15befdf

Browse files
committed
Make std::launder transparent
1 parent 8a4535e commit 15befdf

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎cpp2rust/converter/converter_lib.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,12 +1441,17 @@ bool IsTransparentStdCall(const clang::CallExpr *expr) {
14411441
if (!callee) {
14421442
return false;
14431443
}
1444+
if (callee->isInStdNamespace() && callee->getIdentifier() &&
1445+
callee->getName() == "launder") {
1446+
return true;
1447+
}
14441448
switch (callee->getBuiltinID()) {
14451449
case clang::Builtin::BImove:
14461450
case clang::Builtin::BImove_if_noexcept:
14471451
case clang::Builtin::BIforward:
14481452
case clang::Builtin::BIforward_like:
14491453
case clang::Builtin::BIas_const:
1454+
case clang::Builtin::BI__builtin_launder:
14501455
return true;
14511456
default:
14521457
return false;

0 commit comments

Comments
 (0)