Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0 build failure on macOS: error: calling a private constructor of class 're2c::Rule' #193

Closed
ilovezfs opened this issue Aug 11, 2017 · 6 comments

Comments

@ilovezfs
Copy link

commented Aug 11, 2017

macOS: 10.11.6-x86_64
Xcode: 8.2.1
CLT: 8.2.0.0.1.1480973914
==> Downloading https://github.com/skvadrik/re2c/releases/download/1.0/re2c-1.0.tar.gz
Already downloaded: /Users/joe/Library/Caches/Homebrew/re2c-1.0.tar.gz
==> Verifying re2c-1.0.tar.gz checksum
tar xzf /Users/joe/Library/Caches/Homebrew/re2c-1.0.tar.gz
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/re2c/1.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for bison... /usr/bin/bison
checking for gcc... /usr/bin/clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/clang accepts -g... yes
checking for /usr/bin/clang option to accept ISO C89... none needed
checking whether /usr/bin/clang understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of /usr/bin/clang... none
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/bin/clang++ accepts -g... yes
checking dependency style of /usr/bin/clang++... none
checking C++ compiler flag -std=c++98... yes
checking C++ compiler flag -W... yes
checking C++ compiler flag -Wall... yes
checking C++ compiler flag -Wextra... yes
checking C++ compiler flag -Weffc++... yes
checking C++ compiler flag -pedantic... yes
checking C++ compiler flag -Wformat=2... yes
checking C++ compiler flag -Wredundant-decls... yes
checking C++ compiler flag -Wsuggest-attribute=format... yes
checking C++ compiler flag -Wconversion... yes
checking C++ compiler flag -Wsign-conversion... yes
checking C++ compiler flag -O2... yes
checking C++ compiler flag -Weverything... yes
checking for stdint.h... yes
checking size of char... 1
checking size of short... 2
checking size of int... 4
checking size of long... 8
checking size of long long... 8
checking size of __int64... 0
checking size of void *... 8
checking size of 0l... 8
checking size of 0ll... 8
checking size of 0i8... 0
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/manpage.rst
config.status: creating doc/help.rst
config.status: creating run_tests.sh
config.status: creating config.h
config.status: executing depfiles commands
==> make install
  CXX      src/code/bitmap.o
  CXX      src/code/emit_action.o
  CXX      src/code/emit_dfa.o
  CXX      src/code/label.o
  CXX      src/code/go_construct.o
  CXX      src/code/go_destruct.o
  CXX      src/code/go_emit.o
  CXX      src/code/go_used_labels.o
  CXX      src/code/input_api.o
  CXX      src/code/output.o
  CXX      src/code/print.o
  CXX      src/conf/msg.o
  CXX      src/conf/opt.o
  CXX      src/conf/warn.o
  CXX      src/nfa/dump.o
  CXX      src/nfa/estimate_size.o
  CXX      src/nfa/re_to_nfa.o
  CXX      src/adfa/adfa.o
In file included from src/adfa/adfa.cc:9:
In file included from ./src/adfa/adfa.h:8:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:1028:50: error: calling a private constructor of class 're2c::Rule'
    void     resize(size_t __n, value_type __x = value_type());
                                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:2978:5: note: in instantiation of default function argument expression for 'resize<re2c::Rule>' required here
    resize(0);
    ^
src/adfa/adfa.cc:109:2: note: in instantiation of member function 'std::__1::valarray<re2c::Rule>::~valarray' requested here
        delete &rules;
        ^
./src/re/rule.h:66:14: note: declared private here
        FORBID_COPY(Rule);
                    ^
In file included from src/adfa/adfa.cc:9:
In file included from ./src/adfa/adfa.h:8:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:3711:32: error: calling a private constructor of class 're2c::Rule'
                ::new (__end_) value_type(__x);
                               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:2978:5: note: in instantiation of member function 'std::__1::valarray<re2c::Rule>::resize' requested here
    resize(0);
    ^
src/adfa/adfa.cc:109:2: note: in instantiation of member function 'std::__1::valarray<re2c::Rule>::~valarray' requested here
        delete &rules;
        ^
./src/re/rule.h:66:14: note: declared private here
        FORBID_COPY(Rule);
                    ^
2 errors generated.
make: *** [src/adfa/adfa.o] Error 1
@ilovezfs ilovezfs referenced this issue Aug 11, 2017
@trofi

This comment has been minimized.

Copy link
Contributor

commented Aug 11, 2017

Which upstream clang++ version does xcode-8.2.1 correspond to?

@skvadrik skvadrik closed this in 2aae99c Aug 11, 2017

@skvadrik skvadrik reopened this Aug 11, 2017

@skvadrik

This comment has been minimized.

Copy link
Owner

commented Aug 11, 2017

Please try the fix: 2aae99c
There may be similar errors: on my platform (and a number of other) STL containers std::valarray and std::vector do not require copy semantics if the storage is allocated once (on initialization) and never reallocated. Every time I get rid of "useless" copy constructors I get the same bug reports from macOS users.

@ilovezfs

This comment has been minimized.

@ilovezfs

This comment has been minimized.

Copy link
Author

commented Aug 11, 2017

@skvadrik yes that looks like it worked :)
Homebrew/homebrew-core#16692 is now 🍏

Should I ship with the patch or do you want to tag 1.0.1?

@ilovezfs ilovezfs closed this Aug 11, 2017

@skvadrik

This comment has been minimized.

Copy link
Owner

commented Aug 11, 2017

I will release 1.0.1 now. :)

@ilovezfs

This comment has been minimized.

Copy link
Author

commented Aug 11, 2017

@skvadrik cool, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.