json: compiling with gcc 7 -> error on bool operator <
when compiling i get
json.hpp:6395:66: error: wrong number of template arguments (1, should be 2) return *lhs.m_value.array < *rhs.m_value.array;
and
/usr/include/c++/7/array:94:12: note: provided for ‘template<class _Tp, long unsigned int _Nm> struct std::array’ struct array
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 22 (10 by maintainers)
Links to this issue
Commits related to this issue
- :bug: fixed the issue with GCC7 #590 — committed to nlohmann/json by nlohmann 7 years ago
- fix for gcc bug: https://github.com/nlohmann/json/issues/590#issuecomment-305988306 — committed to ihaveamac/Themely by ihaveamac 7 years ago
- Fix for GCC 7 compilation error in json.hpp from nlohmann/json repository See https://github.com/nlohmann/json/issues/590 — committed to laas/fire-rs-saop by rafael1193 7 years ago
- Fix gcc7 bug See https://github.com/nlohmann/json/issues/590#issuecomment-305988306 — committed to arduino/arduino-preprocessor by facchinm 6 years ago
- Update json parser from nlohmann to fix bug #590 (https://github.com/nlohmann/json/issues/590) — committed to zupino/integratio by zupino 6 years ago
- fix in json.hpp Due to error: https://github.com/nlohmann/json/issues/590 — committed to henrisve/CarND-MPC-Project by henrisve 6 years ago
- resolving compiler bug: https://github.com/nlohmann/json/issues/590 — committed to jandrejk/ProductionFromNano by jandrejk 5 years ago
- Fix for weird compiler regression in gcc. See https://github.com/nlohmann/json/issues/590 — committed to PSC-PublicHealth/phil by danielhertenstein 5 years ago
- Add batch ops and StatusCode for PINs / P4Runtime * Add batch set/delete() to ProducerStateTable * Add StatusCode enum and functions to convert between string and enum values. * Allow exists() to c... — committed to pins/sonic-swss-common-public by deleted user 3 years ago
- Add batch ops and StatusCode for PINs / P4Runtime * Add batch set/delete() to ProducerStateTable * Add StatusCode enum and functions to convert between string and enum values. * Allow exists() to c... — committed to pins/sonic-swss-common-public by deleted user 3 years ago
- Add batch ops and StatusCode for PINS / P4Runtime * Add batch set/delete() to ProducerStateTable * Add StatusCode enum and functions to convert between string and enum values. * Allow exists() to c... — committed to pins/sonic-swss-common-public by deleted user 3 years ago
- Add batch ops and StatusCode for PINS / P4Runtime * Add batch set/delete() to ProducerStateTable * Add StatusCode enum and functions to convert between string and enum values. * Allow exists() to c... — committed to pins/sonic-swss-common-public by deleted user 3 years ago
- Add batch ops and StatusCode for PINS / P4Runtime * Add batch set/delete() to ProducerStateTable * Add StatusCode enum and functions to convert between string and enum values. * Allow exists() to c... — committed to pins/sonic-swss-common-public by deleted user 3 years ago
- Add batch ops and StatusCode for PINS / P4Runtime * Add batch set/delete() to ProducerStateTable * Add StatusCode enum and functions to convert between string and enum values. * Allow exists() to c... — committed to pins/sonic-swss-common-public by deleted user 3 years ago
- Add batch ops and StatusCode for PINS / P4Runtime * Add batch set/delete() to ProducerStateTable * Add StatusCode enum and functions to convert between string and enum values. * Allow exists() to c... — committed to pins/sonic-swss-common-public by deleted user 3 years ago
- Add batch ops and StatusCode for PINS / P4Runtime * Add batch set/delete() to ProducerStateTable * Add StatusCode enum and functions to convert between string and enum values. * Allow exists() to c... — committed to pins/sonic-swss-common-public by deleted user 3 years ago
Changing the line in
json.hpp
to readseems to fix the error using that simple test case. It’s quite possible this is a GCC bug; I can’t understand why
.array<
should be interpreted as template parameters toarray
with that.
preceding it. Furthermore, clang compiles the snippet without issue in C++11 and in C++14 mode.I tried to help @alberto2000 track this down in IRC earlier. In https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/utils/ofConstants.h#L435 – ‘using namespace std;’ is present and indirectly ahead of the include for json.hpp, which seems to trigger the issue.
@buffos – your code also has a ‘using namespace std;’ indirectly before json.hpp is included
@nlohmann – I did the same as @whenov and had the same error message about template arguments, which goes away if ‘using namespace std;’ is commented out. The test suite built and ran fine.