Skip to content

Commit 26e3056

Browse files
committed
[cxx-interop] Fix ambiguous 'exit' (same solution as above).
1 parent 067abeb commit 26e3056

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3208,7 +3208,7 @@ namespace {
32083208
return false;
32093209
return d->getName() == "abs" || d->getName() == "div" ||
32103210
d->getName() == "strstr" || d->getName() == "sin" ||
3211-
d->getName() == "cos";
3211+
d->getName() == "cos" || d->getName() == "exit";
32123212
};
32133213
if (decl->getOwningModule() &&
32143214
(decl->getOwningModule()

test/Interop/Cxx/stdlib/avoid-import-cxx-math.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ func test() {
2121
let _ = CxxStdlib.abs(x) // expected-error {{module 'CxxStdlib' has no member named 'abs'}}
2222
let _ = CxxStdlib.div(x) // expected-error {{module 'CxxStdlib' has no member named 'div'}}
2323
let _ = CxxStdlib.strstr("a", "aaa") // expected-error {{module 'CxxStdlib' has no member named 'strstr'}}
24+
25+
exit(0)
2426
}

0 commit comments

Comments
 (0)