Grid icon indicating copy to clipboard operation
Grid copied to clipboard

JSON_IO.cc fails to compile on BG/Q with bglclang (fix included)

Open giltirn opened this issue 8 years ago • 1 comments

lib/serialisation/JSON_IO.cc fails to compile with bgclang r284961-stable clang version 4.0.0 (based on LLVM 4.0.0svn) with the following error:

/bgusr/home/ckelly/CPS2/src/grid_git/Grid/lib/serialisation/JSON_IO.cc:167:12: error: use of overloaded operator '=' is ambiguous (with operand types 'string' (aka 'basic_string<char, char_traits, allocator >') and 'value_type' (aka 'nlohmann::basic_json<std::map, std::vector, std::_1::basic_string, bool, long, unsigned long, double, std::allocator, adl_serializer>')) output = jcur[s]; ~~~~~~ ^ ~~~~~~~~ /opt/bgclang/r284961-stable/libc++/include/c++/v1/string:814:19: note: candidate function basic_string& operator=(const basic_string& __str); ^ /opt/bgclang/r284961-stable/libc++/include/c++/v1/string:816:19: note: candidate function basic_string& operator=(__self_view __sv) {return assign(__sv);} ^ /opt/bgclang/r284961-stable/libc++/include/c++/v1/string:819:19: note: candidate function basic_string& operator=(basic_string&& _str) ^ /bgusr/home/ckelly/CPS2/src/grid_git/Grid/lib/serialisation/JSON_IO.cc:172:12: error: use of overloaded operator '=' is ambiguous (with operand types 'string' (aka 'basic_string<char, char_traits, allocator >') and 'json' (aka 'basic_json<>')) output = jcur;
~~~~~~ ^ ~~~~~ /opt/bgclang/r284961-stable/libc++/include/c++/v1/string:814:19: note: candidate function basic_string& operator=(const basic_string& __str); ^ /opt/bgclang/r284961-stable/libc++/include/c++/v1/string:816:19: note: candidate function basic_string& operator=(__self_view __sv) {return assign(__sv);} ^ /opt/bgclang/r284961-stable/libc++/include/c++/v1/string:819:19: note: candidate function basic_string& operator=(basic_string&& __str) ^

To fix this you can replace line 167 with

output = jcur_[s].getstd::string();

and 172 with

output = jcur_.getstd::string();

giltirn avatar Dec 07 '17 17:12 giltirn

Status of this?

paboyle avatar Mar 09 '18 20:03 paboyle