]> granicus.if.org Git - re2c/commitdiff
Fixed #193: "1.0 build failure on macOS: error: calling a private constructor of...
authorUlya Trofimovich <skvadrik@gmail.com>
Fri, 11 Aug 2017 21:04:05 +0000 (22:04 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Fri, 11 Aug 2017 21:04:05 +0000 (22:04 +0100)
Copy constructor and assignment are requred by std::valarray
implementation on macOS.

re2c/src/re/rule.h

index 1f9dcf58e5b792a52cceba94b4babc5671855b97..803281cc9c88402d596e180a643f4c103998e07d 100644 (file)
@@ -7,7 +7,6 @@
 #include <string>
 
 #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