From: Ulya Trofimovich Date: Fri, 11 Aug 2017 21:04:05 +0000 (+0100) Subject: Fixed #193: "1.0 build failure on macOS: error: calling a private constructor of... X-Git-Tag: 1.0.1~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2aae99cd950ef519580378261d720462b4c6d72a;p=re2c Fixed #193: "1.0 build failure on macOS: error: calling a private constructor of class 're2c::Rule'". Copy constructor and assignment are requred by std::valarray implementation on macOS. --- diff --git a/re2c/src/re/rule.h b/re2c/src/re/rule.h index 1f9dcf58..803281cc 100644 --- a/re2c/src/re/rule.h +++ b/re2c/src/re/rule.h @@ -7,7 +7,6 @@ #include #include "src/re/tag.h" -#include "src/util/forbid_copy.h" #include "src/util/free_list.h" namespace re2c @@ -63,7 +62,26 @@ struct Rule Rule(): code(NULL), shadow(), ltag(0), htag(0), ttag(0), ncap(0) {} - FORBID_COPY(Rule); + + // copy ctor and assignment are required for containers on macOS + Rule(const Rule &r) + : code(r.code) + , shadow(r.shadow) + , ltag(r.ltag) + , htag(r.htag) + , ttag(r.ttag) + , ncap(r.ncap) + {} + Rule& operator= (const Rule &r) + { + code = r.code; + shadow = r.shadow; + ltag = r.ltag; + htag = r.htag; + ttag = r.ttag; + ncap = r.ncap; + return *this; + } }; } // namespace re2c