Skip to content

Bugfix for nonconst has in generated flag_enums. #1070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions regression-tests/test-results/pure2-enum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public: constexpr auto operator^=(file_attributes const& that) & -> void;
public: [[nodiscard]] constexpr auto operator|(file_attributes const& that) const& -> file_attributes;
public: [[nodiscard]] constexpr auto operator&(file_attributes const& that) const& -> file_attributes;
public: [[nodiscard]] constexpr auto operator^(file_attributes const& that) const& -> file_attributes;
public: [[nodiscard]] constexpr auto has(file_attributes const& that) & -> bool;
public: [[nodiscard]] constexpr auto has(file_attributes const& that) const& -> bool;
public: constexpr auto set(file_attributes const& that) & -> void;
public: constexpr auto clear(file_attributes const& that) & -> void;
public: static const file_attributes cached;
Expand Down Expand Up @@ -202,7 +202,7 @@ constexpr auto file_attributes::operator^=(file_attributes const& that) & -> voi
[[nodiscard]] constexpr auto file_attributes::operator|(file_attributes const& that) const& -> file_attributes { return _value | that._value; }
[[nodiscard]] constexpr auto file_attributes::operator&(file_attributes const& that) const& -> file_attributes { return _value & that._value; }
[[nodiscard]] constexpr auto file_attributes::operator^(file_attributes const& that) const& -> file_attributes { return _value ^ that._value; }
[[nodiscard]] constexpr auto file_attributes::has(file_attributes const& that) & -> bool { return _value & that._value; }
[[nodiscard]] constexpr auto file_attributes::has(file_attributes const& that) const& -> bool { return _value & that._value; }
constexpr auto file_attributes::set(file_attributes const& that) & -> void { _value |= that._value; }
constexpr auto file_attributes::clear(file_attributes const& that) & -> void { _value &= ~that._value; }
inline CPP2_CONSTEXPR file_attributes file_attributes::cached = 1;
Expand Down
2 changes: 1 addition & 1 deletion source/reflect.h
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ std::string value{"-1"};
CPP2_UFCS(add_member)(t, (" operator| : ( this, that ) -> " + cpp2::to_string(CPP2_UFCS(name)(t)) + " == _value | that._value;"));
CPP2_UFCS(add_member)(t, (" operator& : ( this, that ) -> " + cpp2::to_string(CPP2_UFCS(name)(t)) + " == _value & that._value;"));
CPP2_UFCS(add_member)(t, (" operator^ : ( this, that ) -> " + cpp2::to_string(CPP2_UFCS(name)(t)) + " == _value ^ that._value;"));
CPP2_UFCS(add_member)(t, " has : ( inout this, that ) -> bool == _value & that._value;");
CPP2_UFCS(add_member)(t, " has : ( this, that ) -> bool == _value & that._value;");
CPP2_UFCS(add_member)(t, " set : ( inout this, that ) == _value |= that._value;");
CPP2_UFCS(add_member)(t, " clear : ( inout this, that ) == _value &= that._value~;");
}
Expand Down
2 changes: 1 addition & 1 deletion source/reflect.h2
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ basic_enum: (
t.add_member( " operator| : ( this, that ) -> (t.name())$ == _value | that._value;");
t.add_member( " operator& : ( this, that ) -> (t.name())$ == _value & that._value;");
t.add_member( " operator^ : ( this, that ) -> (t.name())$ == _value ^ that._value;");
t.add_member( " has : ( inout this, that ) -> bool == _value & that._value;");
t.add_member( " has : ( this, that ) -> bool == _value & that._value;");
t.add_member( " set : ( inout this, that ) == _value |= that._value;");
t.add_member( " clear : ( inout this, that ) == _value &= that._value~;");
}
Expand Down
Loading