QmlJS: Fix inconsistent copy ctor/operator=

Detected by GCC9.

Change-Id: Ieab7c13c6d66b99cc679c3ac5d4a3da67bcd7767
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Orgad Shaneh
2019-05-06 23:56:41 +03:00
committed by Orgad Shaneh
parent 5cf087ac5d
commit c8f0d3f008
9 changed files with 11 additions and 23 deletions

View File

@@ -545,7 +545,6 @@ QDebug &operator<<(QDebug &dbg, const Trie &trie)
}
Trie::Trie() {}
Trie::Trie(const TrieNode::Ptr &trie) : trie(trie) {}
Trie::Trie(const Trie &o) : trie(o.trie){}
QStringList Trie::complete(const QString &root, const QString &base,
LookupFlags flags) const

View File

@@ -79,7 +79,6 @@ class QMLJS_EXPORT Trie
public:
Trie();
Trie(const TrieNode::Ptr &t);
Trie(const Trie &o);
QStringList complete(const QString &root, const QString &base = QString(),
LookupFlags flags = LookupFlags(CaseInsensitive|Partial)) const;

View File

@@ -35,11 +35,6 @@
namespace QmlJS {
typedef PersistentTrie::Trie Trie;
QmlBundle::QmlBundle(const QmlBundle &o)
: m_name(o.m_name), m_searchPaths(o.searchPaths()), m_installPaths(o.installPaths()),
m_supportedImports(o.m_supportedImports), m_implicitImports(o.m_implicitImports)
{ }
QmlBundle::QmlBundle()
{ }

View File

@@ -51,7 +51,6 @@ class QMLJS_EXPORT QmlBundle
{
typedef PersistentTrie::Trie Trie;
public:
QmlBundle(const QmlBundle &o);
QmlBundle();
QmlBundle(const QString &name,
const Trie &searchPaths,

View File

@@ -79,9 +79,6 @@ QMLJS_EXPORT QDebug operator << (QDebug &dbg, const Dialect &dialect);
class QMLJS_EXPORT PathAndLanguage {
public:
PathAndLanguage(const Utils::FileName &path = Utils::FileName(), Dialect language = Dialect::AnyLanguage);
PathAndLanguage(const PathAndLanguage &o)
: m_path(o.path()), m_language(o.language())
{ }
Utils::FileName path() const {
return m_path;
}
@@ -130,9 +127,6 @@ public:
explicit PathsAndLanguages(const QList<PathAndLanguage> &list)
: m_list(list)
{ }
PathsAndLanguages(const PathsAndLanguages &o)
: m_list(o.m_list)
{ }
bool maybeInsert(const Utils::FileName &path, Dialect language = Dialect::AnyLanguage) {
return maybeInsert(PathAndLanguage(path, language));

View File

@@ -458,14 +458,6 @@ Snapshot::~Snapshot()
{
}
Snapshot::Snapshot(const Snapshot &o)
: _documents(o._documents),
_documentsByPath(o._documentsByPath),
_libraries(o._libraries),
_dependencies(o._dependencies)
{
}
void Snapshot::insert(const Document::Ptr &document, bool allowInvalid)
{
if (document && (allowInvalid || document->qmlProgram() || document->jsProgram())) {

View File

@@ -230,7 +230,6 @@ class QMLJS_EXPORT Snapshot
public:
Snapshot();
Snapshot(const Snapshot &o);
~Snapshot();
typedef Base::iterator iterator;

View File

@@ -2340,6 +2340,16 @@ Import::Import(const Import &other)
valid(other.valid), used(false)
{ }
Import &Import::operator=(const Import &other)
{
object = other.object;
info = other.info;
libraryPath = other.libraryPath;
valid = other.valid;
used = false;
return *this;
}
TypeScope::TypeScope(const Imports *imports, ValueOwner *valueOwner)
: ObjectValue(valueOwner)
, m_imports(imports)

View File

@@ -1038,6 +1038,7 @@ class QMLJS_EXPORT Import {
public:
Import();
Import(const Import &other);
Import &operator=(const Import &other);
// const!
ObjectValue *object;