File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -3200,15 +3200,18 @@ namespace {
3200
3200
// presence in the C++ standard library will cause overloading
3201
3201
// ambiguities or other type checking errors in Swift.
3202
3202
auto isAlternativeCStdlibFunctionFromTextualHeader =
3203
- [](const clang::FunctionDecl *d) -> bool {
3203
+ [this ](const clang::FunctionDecl *d) -> bool {
3204
3204
// stdlib.h might be a textual header in libc++'s module map.
3205
3205
// in this case, check for known ambiguous functions by their name
3206
3206
// instead of checking if they come from the `std` module.
3207
3207
if (!d->getDeclName ().isIdentifier ())
3208
3208
return false ;
3209
- return d->getName () == " abs" || d->getName () == " div" ||
3210
- d->getName () == " strstr" || d->getName () == " sin" ||
3211
- d->getName () == " cos" || d->getName () == " exit" ;
3209
+ if (d->getName () == " abs" || d->getName () == " div" )
3210
+ return true ;
3211
+ if (Impl.SwiftContext .LangOpts .Target .isOSDarwin ())
3212
+ return d->getName () == " strstr" || d->getName () == " sin" ||
3213
+ d->getName () == " cos" || d->getName () == " exit" ;
3214
+ return false ;
3212
3215
};
3213
3216
if (decl->getOwningModule () &&
3214
3217
(decl->getOwningModule ()
Original file line number Diff line number Diff line change 5
5
import CxxStdlib
6
6
7
7
func test( ) {
8
- let x : Float = 1.0
9
- let y : Float = 2.0
8
+ let x : Double = 1.0
9
+ let y : Double = 2.0
10
10
11
11
let _ = pow ( x, y)
12
12
13
13
let _ = abs ( x)
14
14
let _ = div ( 42 , 2 )
15
+ let _ = sin ( x)
16
+ let _ = cos ( x)
15
17
let _ = strstr ( " a " , " aaa " )
16
18
17
19
exit ( 0 )
You can’t perform that action at this time.
0 commit comments