giomasce / mmpp

Metamath in C++
11 stars 2 forks source link

provers/subst.cpp build error with gcc/g++ 5.4.0 on Ubuntu 16.04 LTS #4

Closed marnix closed 6 years ago

marnix commented 6 years ago

Building commit c964d72 fails on provers/subst.cpp

https://github.com/giomasce/mmpp/blob/c964d7288563d2f7d5c61c4addfebe374f81241e/provers/subst.cpp#L30-L63

on Ubuntu 16.04 LTS using gcc/g++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609, with the following build error:

> make
g++ -c -m64 -pipe -g -ftemplate-backtrace-limit=0 -Og -std=c++1y -Wall -W -fPIC -DPROJ_DIR="\"/home/marnix/projects/mmpp\"" -DDISABLE_TESTS -DUSE_MICROHTTPD -DUSE_Z3 -I../../mmpp -I. -isystem /usr/include/p11-kit-1 -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o subst.o ../provers/subst.cpp
../provers/subst.cpp:63:1: error: converting to ‘std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >’ from initializer list would use explicit constructor ‘constexpr std::tuple< <template-parameter-1-1> >::tuple(const _Elements& ...) [with _Elements = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >}]’
 };
 ^

I have no idea yet what could be the cause, except that perhaps https://stackoverflow.com/q/26947704/223837 might be related.

giomasce commented 6 years ago

Ok, I can reproduce it using GCC 5. The error seems to be correct (i.e., the code is not C++14 correct), because the tuple constructor under consideration is indeed defined to be explicit in C++14. I usually compile with GCC 7, which (event specifying -std=c++1y) uses a more modern standard library, where this behaviour has been changed in conformance with C++17. I will try to find the least invasive fix to this thing.

giomasce commented 6 years ago

Ok, I just sent a fix that works with GCC 5.5 on my system. Please let me know if there are other problems and thanks for the report!

marnix commented 6 years ago

Confirmed fixed: I have a successful build now, thanks!