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 @@ -3197,15 +3197,18 @@ namespace {
3197
3197
// presence in the C++ standard library will cause overloading
3198
3198
// ambiguities or other type checking errors in Swift.
3199
3199
auto isAlternativeCStdlibFunctionFromTextualHeader =
3200
- [](const clang::FunctionDecl *d) -> bool {
3200
+ [this ](const clang::FunctionDecl *d) -> bool {
3201
3201
// stdlib.h might be a textual header in libc++'s module map.
3202
3202
// in this case, check for known ambiguous functions by their name
3203
3203
// instead of checking if they come from the `std` module.
3204
3204
if (!d->getDeclName ().isIdentifier ())
3205
3205
return false ;
3206
- return d->getName () == " abs" || d->getName () == " div" ||
3207
- d->getName () == " strstr" || d->getName () == " sin" ||
3208
- d->getName () == " cos" || d->getName () == " exit" ;
3206
+ if (d->getName () == " abs" || d->getName () == " div" )
3207
+ return true ;
3208
+ if (Impl.SwiftContext .LangOpts .Target .isOSDarwin ())
3209
+ return d->getName () == " strstr" || d->getName () == " sin" ||
3210
+ d->getName () == " cos" || d->getName () == " exit" ;
3211
+ return false ;
3209
3212
};
3210
3213
if (decl->getOwningModule () &&
3211
3214
(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