Files
swift-mirror/test/Interop/Cxx/stdlib/Inputs/std-string.h
Egor Zhdan d594f475ee [cxx-interop] Check for unsafe types of default arguments consistently
If the C++ type of a function parameter defines a custom copy constructor, assume that it is safe to use from Swift. This matches the heuristic that we use to detect if a C++ method is safe based on the return type.

rdar://121391798
2024-01-26 19:26:27 +00:00

9 lines
226 B
C++

#include <string>
struct HasMethodThatReturnsString {
int value = 111;
std::string getString() const { return std::to_string(value); }
};
inline std::string takesStringWithDefaultArg(std::string s = "abc") { return s; }