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

Compilation issue with gcc 7.2 #742

Closed
cdehnert opened this issue Sep 14, 2017 · 3 comments
Closed

Compilation issue with gcc 7.2 #742

cdehnert opened this issue Sep 14, 2017 · 3 comments
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead

Comments

@cdehnert
Copy link

When compiling with the newly released gcc 7.2, I get the following compilation error:

/tmp/makepkg/stormchecker-git/src/stormchecker-git/resources/3rdparty/modernjson/src/json.hpp: In function ‘bool nlohmann::operator<(nlohmann::basic_json<ObjectType, ArrayType, StringType, Boole
anType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::const_reference, nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUns
ignedType, NumberFloatType, AllocatorType>::const_reference)’:
/tmp/makepkg/stormchecker-git/src/stormchecker-git/resources/3rdparty/modernjson/src/json.hpp:5653:66: error: wrong number of template arguments (1, should be 2)
                        return *lhs.m_value.array < *rhs.m_value.array;
                                                                 ^~~~~
In file included from /usr/include/c++/7.2.0/tuple:39:0,
                from /usr/include/c++/7.2.0/bits/unique_ptr.h:37,
                from /usr/include/c++/7.2.0/memory:80,
                from /tmp/makepkg/stormchecker-git/src/stormchecker-git/src/storm-pars/api/region.h:6,
                from /tmp/makepkg/stormchecker-git/src/stormchecker-git/src/storm-pars/api/storm-pars.h:3,
                from /tmp/makepkg/stormchecker-git/src/stormchecker-git/src/storm-pars-cli/storm-pars.cpp:2:
/usr/include/c++/7.2.0/array:94:12: note: provided for ‘template<class _Tp, long unsigned int _Nm> struct std::array’
    struct array
           ^~~~~
make[3]: *** [src/storm-pars-cli/CMakeFiles/storm-pars-cli.dir/build.make:63: src/storm-pars-cli/CMakeFiles/storm-pars-cli.dir/storm-pars.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:2143: src/storm-pars-cli/CMakeFiles/storm-pars-cli.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:1408: src/CMakeFiles/binaries.dir/rule] Error 2
make: *** [Makefile:704: binaries] Error 2

For gcc < 7.1.0 everything went smoothly until now. To be honest, I cannot really wrap my head around the compilation error, as a) m_value.array appears to be of type std::vector<>* and not std::array<>* and b) no template arguments are given in the line that is being pointed to.

@tbergmueller
Copy link

tbergmueller commented Sep 14, 2017

Well - that's perfect timing, just encountered the very same issue.

For me, this happens on Arch-Linux with gcc 7.2.2. Details on my used package:

pacman -Qi gcc                                                                                                     :(
Name            : gcc
Version         : 7.2.0-2
Description     : The GNU Compiler Collection - C and C++ frontends
Architecture    : x86_64
URL             : http://gcc.gnu.org
Licenses        : GPL  LGPL  FDL  custom
Groups          : base-devel
Provides        : None
Depends On      : gcc-libs=7.2.0-2  binutils>=2.28  libmpc
Optional Deps   : None
Required By     : clang
Optional For    : clion-eap  xorg-xrdb
Conflicts With  : None
Replaces        : None
Installed Size  : 115.62 MiB
Packager        : Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
Build Date      : Sa 19 Aug 2017 11:03:15 CEST
Install Date    : Mo 11 Sep 2017 18:53:15 CEST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Not quite sure whether this is an error of the library or of GCC. With 7.1 (running on our build system) and earlier everything works well

edit
Downgrading GCC to 7.1.1-4 solves the problem

@nlohmann
Copy link
Owner

Maybe related: #606

@cdehnert
Copy link
Author

Indeed this happens to be a duplicate, thanks for pointing me there!

@nlohmann nlohmann added the solution: duplicate the issue is a duplicate; refer to the linked issue instead label Sep 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead
Projects
None yet
Development

No branches or pull requests

3 participants