mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
For C++ types that are defined in the bridging header, or are `#include`-d from the bridging header, we did not generate the automatic conformances to `CxxSequence`, `CxxRandomAccessCollection` protocols. To check whether we should try to conform a C++ type to those protocols, the compiler checks for the presence of `requires cplusplus` in the module declaration in a modulemap file. This check is there to prevent us from accidentally pulling in `Cxx`/`CxxStdlib` modules when a client is importing a C library. This change makes sure those conformances are generated. rdar://121927459
26 lines
580 B
C++
26 lines
580 B
C++
#ifndef TEST_INTEROP_CXX_STDLIB_INPUTS_STD_VECTOR_H
|
|
#define TEST_INTEROP_CXX_STDLIB_INPUTS_STD_VECTOR_H
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
using Vector = std::vector<int>;
|
|
using VectorOfString = std::vector<std::string>;
|
|
|
|
inline Vector initVector() { return {}; }
|
|
|
|
inline std::string takesVectorOfString(const VectorOfString &v) {
|
|
return v.front();
|
|
}
|
|
|
|
class VectorSubclass: public Vector {
|
|
public:
|
|
};
|
|
|
|
class VectorOfStringSubclass : public std::vector<std::string> {
|
|
public:
|
|
using std::vector<std::string>::vector;
|
|
};
|
|
|
|
#endif // TEST_INTEROP_CXX_STDLIB_INPUTS_STD_VECTOR_H
|