File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -2570,6 +2570,9 @@ void TypeChecker::addImplicitDynamicAttribute(Decl *D) {
2570
2570
// Don't add dynamic to defer bodies.
2571
2571
if (FD->isDeferBody ())
2572
2572
return ;
2573
+ // Don't add dynamic to functions with a cdecl.
2574
+ if (FD->getAttrs ().hasAttribute <CDeclAttr>())
2575
+ return ;
2573
2576
}
2574
2577
2575
2578
if (auto *VD = dyn_cast<VarDecl>(D)) {
Original file line number Diff line number Diff line change @@ -357,6 +357,11 @@ dynamic func funcWithDefaultArg(_ arg : String = String("hello")) {
357
357
print ( " hello " )
358
358
}
359
359
360
+ // IMPLICIT-LABEL: sil hidden [thunk] [ossa] @barfoo
361
+ @_cdecl ( " barfoo " )
362
+ func foobar( ) {
363
+ }
364
+
360
365
// IMPLICIT-LABEL: sil private [ossa] @$s23dynamically_replaceable6$deferL_yyF
361
366
var x = 10
362
367
defer {
You can’t perform that action at this time.
0 commit comments