cppparser: fix class with array member not seen as copy-constructible

This commit is contained in:
rdb 2018-06-09 10:29:34 +02:00
parent acac93a1d1
commit fa6d8b4b39
2 changed files with 16 additions and 1 deletions

View File

@ -93,7 +93,21 @@ is_default_constructible() const {
*/
bool CPPArrayType::
is_copy_constructible() const {
return false;
// This is technically not exactly true, but array data members do not
// prevent C++ implicit copy constructor generation rules, so we need to
// return true here.
// If this is a problem, we will need to create a separate method for the
// purpose of checking copyability as a data member.
return true;
}
/**
* Returns true if the type is copy-assignable.
*/
bool CPPArrayType::
is_copy_assignable() const {
// Same story as is_copy_constructible.
return true;
}
/**

View File

@ -42,6 +42,7 @@ public:
virtual bool is_trivial() const;
virtual bool is_default_constructible() const;
virtual bool is_copy_constructible() const;
virtual bool is_copy_assignable() const;
virtual bool is_equivalent(const CPPType &other) const;
virtual void output(std::ostream &out, int indent_level, CPPScope *scope,