Files
swift-mirror/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift
Egor Zhdan 1be7230876 [cxx-interop] Use C++17 standard by default
Clang is using C++17 standard version by default since Clang 16.

Swift’s ClangImporter should do the same, to make sure that clients who run clang and then swiftc without explicit std version see consistent behavior.

rdar://125777068
2024-04-02 16:23:32 +01:00

18 lines
738 B
Swift

// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop)
// REQUIRES: OS=windows-msvc
// REQUIRES: executable_test
import MsvcUseVecIt
// CHECK: call void @"?begin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEBA?AV?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@@2@XZ"(ptr {{.*}}, ptr noalias nocapture sret
func test() -> Bool {
let result = f()
let begin = result.pointee.providers.__beginUnsafe()
let end = result.pointee.providers.__endUnsafe()
return begin != end
}
let _ = test()