potassco / clingo

🤔 A grounder and solver for logic programs.
https://potassco.org/clingo
MIT License
601 stars 79 forks source link

gringo/terms.hh:190:16: error: exception specification of explicitly defaulted move assignment operator does not match the calculated one #404

Closed barracuda156 closed 1 year ago

barracuda156 commented 1 year ago

clingo 5.6.2 fails to build on 10.10–10.14 with:

In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_clingo/clingo/work/clingo-5.6.2/libgringo/src/terms.cc:25:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_clingo/clingo/work/clingo-5.6.2/libgringo/gringo/terms.hh:190:16: error: exception specification of explicitly defaulted move assignment operator does not match the calculated one
    TheoryDef &operator=(TheoryDef &&other) noexcept = default;
               ^
1 error generated.
make[2]: *** [libgringo/CMakeFiles/libgringo.dir/src/terms.cc.o] Error 1

Complete log from 10.14: https://build.macports.org/builders/ports-10.14_x86_64-builder/builds/151183/steps/install-port/logs/stdio

barracuda156 commented 1 year ago

Perhaps related: https://github.com/dealii/dealii/issues/12313

rkaminsk commented 1 year ago

Looks like some involved types have move assignment operators that are not marked as nothrow.

This compiles on my linux box using clang 10. However, I have libc++ 14 installed. So I suppose that a too old libc++ is being used. If you want to use an older library, the only workaround that comes to my mind would be to remove the nothrow specifiers. Since 10.10 to 10.14 are all end of life, I don't see a need to patch, though.

barracuda156 commented 1 year ago

Looks like some involved types have move assignment operators that are not marked as nothrow.

This compiles on my linux box using clang 10. However, I have libc++ 14 installed. So I suppose that a too old libc++ is being used. If you want to use an older library, the only workaround that comes to my mind would be to remove the nothrow specifiers. Since 10.10 to 10.14 are all end of life, I don't see a need to patch, though.

@rkaminsk This is up to you, of course, whether to implement a fix or not. If it cannot be fixed here in upstream, we can add a local patch in Macports. (I won’t be allowed to switch those OSs to using GCC – which compiles clingo without errors even on 10.5.)

rkaminsk commented 1 year ago

I'ld rather not spend time to support software that is end of life.

barracuda156 commented 1 year ago

Should be fixed by blacklisting Apple Clang on those systems, since LLVM Clang works fine.

barracuda156 commented 1 year ago

Blacklist worked, clingo builds fine now across the board: https://ports.macports.org/port/clingo/details/