mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
In https://github.com/swiftlang/swift/pull/78467 and https://github.com/swiftlang/swift/pull/78961, we stopped emitting metadata for private C++ fields. However, this created a mismatch between the fields emitted and the number of fields + their offsets in the StructDescriptor.
rdar://147263490
(cherry picked from commit 72b13b3b48)
37 lines
830 B
C++
37 lines
830 B
C++
#include <string>
|
|
#include <vector>
|
|
|
|
struct Item {
|
|
std::vector<std::string> keys;
|
|
std::vector<std::string> values;
|
|
};
|
|
|
|
inline Item get_item() {
|
|
return {};
|
|
}
|
|
|
|
std::vector<int> makeVecOfInt() { return {1, 2, 3}; }
|
|
std::vector<std::string> makeVecOfString() { return {"Hello", "World"}; }
|
|
|
|
struct S {
|
|
private:
|
|
std::string privStr;
|
|
std::vector<std::string> privVec;
|
|
|
|
public:
|
|
std::string pubStr;
|
|
std::vector<std::string> pubVec;
|
|
|
|
protected:
|
|
std::string protStr;
|
|
std::vector<std::string> protVec;
|
|
|
|
public:
|
|
S() : privStr("private"), privVec({"private", "vector"}),
|
|
pubStr("public"), pubVec({"a", "public", "vector"}),
|
|
protStr("protected"), protVec({"protected", "vector"}) {}
|
|
|
|
std::vector<std::string> getPrivVec() const { return privVec; }
|
|
std::string getProtStr() const { return protStr; }
|
|
};
|