Make TypePtr::Capture member variables private

The public versions were marked as deprecated for 7.0, and accessors
should be used to manage them now.
This commit is contained in:
Tim Wojtulewicz 2024-08-04 21:34:49 -07:00
parent a53cc4d01b
commit 260a8afebe
2 changed files with 4 additions and 9 deletions

View file

@ -599,12 +599,9 @@ TypePtr SetType::ShallowClone() { return make_intrusive<SetType>(indices, elemen
SetType::~SetType() = default;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
FuncType::Capture::Capture(detail::IDPtr _id, bool _deep_copy) : id(std::move(_id)), deep_copy(_deep_copy) {
is_managed = id ? ZVal::IsManagedType(id->GetType()) : false;
}
#pragma GCC diagnostic pop
FuncType::FuncType(RecordTypePtr arg_args, TypePtr arg_yield, FunctionFlavor arg_flavor)
: Type(TYPE_FUNC), args(std::move(arg_args)), arg_types(make_intrusive<TypeList>()), yield(std::move(arg_yield)) {

View file

@ -513,8 +513,6 @@ public:
public:
Capture(detail::IDPtr _id, bool _deep_copy);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Capture(const Capture&) = default;
Capture(Capture&&) = default;
Capture& operator=(const Capture&) = default;
@ -527,11 +525,11 @@ public:
// For script optimization:
void SetID(detail::IDPtr new_id) { id = std::move(new_id); }
#pragma GCC diagnostic pop
[[deprecated("Remove in v7.1. Use non-default constructor and associated accessors.")]] detail::IDPtr id;
[[deprecated("Remove in v7.1. Use non-default constructor and associated accessors.")]] bool deep_copy;
[[deprecated("Remove in v7.1. Use non-default constructor and associated accessors.")]] bool is_managed;
private:
detail::IDPtr id;
bool deep_copy;
bool is_managed;
};
using CaptureList = std::vector<Capture>;