mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-07 09:16:53 +08:00
Fix bug exposed while moving to constexpr
This commit is contained in:
parent
21500a1dcc
commit
d56c5b489b
@ -12,8 +12,23 @@ class TestBaseType
|
|||||||
TestBaseType(int) : val(10), const_val(15), mdarray{} { }
|
TestBaseType(int) : val(10), const_val(15), mdarray{} { }
|
||||||
TestBaseType(int *) : val(10), const_val(15), mdarray{} { }
|
TestBaseType(int *) : val(10), const_val(15), mdarray{} { }
|
||||||
|
|
||||||
TestBaseType(const TestBaseType &) = default;
|
TestBaseType(const TestBaseType &other)
|
||||||
virtual ~TestBaseType() {}
|
: val(other.val), const_val(other.const_val), const_val_ptr(&const_val),
|
||||||
|
func_member(other.func_member)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
TestBaseType(TestBaseType &&other)
|
||||||
|
: val(other.val), const_val(other.const_val), const_val_ptr(&const_val),
|
||||||
|
func_member(std::move(other.func_member))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TestBaseType &operator=(TestBaseType &&) = delete;
|
||||||
|
TestBaseType &operator=(const TestBaseType &) = delete;
|
||||||
|
|
||||||
|
virtual ~TestBaseType() = default;
|
||||||
virtual int func() { return 0; }
|
virtual int func() { return 0; }
|
||||||
|
|
||||||
int base_only_func() { return -9; }
|
int base_only_func() { return -9; }
|
||||||
@ -36,8 +51,6 @@ class TestBaseType
|
|||||||
t_str = "42";
|
t_str = "42";
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
TestBaseType &operator=(const TestBaseType &) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Type2
|
class Type2
|
||||||
@ -78,22 +91,14 @@ int to_int(TestEnum t)
|
|||||||
class TestDerivedType : public TestBaseType
|
class TestDerivedType : public TestBaseType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
~TestDerivedType() override {}
|
|
||||||
TestDerivedType(const TestDerivedType &) = default;
|
|
||||||
TestDerivedType() = default;
|
|
||||||
virtual int func() override { return 1; }
|
virtual int func() override { return 1; }
|
||||||
int derived_only_func() { return 19; }
|
int derived_only_func() { return 19; }
|
||||||
|
|
||||||
private:
|
|
||||||
TestDerivedType &operator=(const TestDerivedType &) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class TestMoreDerivedType : public TestDerivedType
|
class TestMoreDerivedType : public TestDerivedType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TestMoreDerivedType(const TestMoreDerivedType &) = default;
|
|
||||||
TestMoreDerivedType() = default;
|
|
||||||
virtual ~TestMoreDerivedType() {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
std::shared_ptr<TestBaseType> derived_type_factory()
|
std::shared_ptr<TestBaseType> derived_type_factory()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user