From caad9bd997e95b3ccdf496313588b8480ebfddfa Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 12 Sep 2019 22:34:15 +0300 Subject: [PATCH] Appease the compiler with some extra copy-ctor's and operator='s In C++11 if you manually define either a copy constructor or an assignment operator, you must define the other as well. --- source/programsyntax.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/programsyntax.h b/source/programsyntax.h index 59042951..e7b5111e 100644 --- a/source/programsyntax.h +++ b/source/programsyntax.h @@ -20,6 +20,9 @@ struct NodeVisitor; struct Node { +protected: + Node() { } + Node(const Node &) { } private: Node &operator=(const Node &); public: @@ -36,6 +39,7 @@ public: NodePtr() { } NodePtr(T *p): RefPtr(p) { } NodePtr(const NodePtr &p): RefPtr(p ? p->clone() : 0) { } + NodePtr &operator=(const NodePtr &p) { RefPtr::operator=(p); return *this; } template NodePtr(const RefPtr &p): RefPtr(p) { } -- 2.43.0