Conversion to ‘Json::Value’ is ambiguous
The issue seems to have been introduced by 482497e0debc3de9f125c8c849a40872971a4a7e.
[ 35%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmMakefileExecutableTargetGenerator.cxx.o
cd /opt/cmake/cmake/Build/Source && /usr/bin/g++ -I/opt/cmake/cmake/Build/Utilities -I/opt/cmake/cmake/Utilities -I/opt/cmake/cmake/Build/Source -I/opt/cmake/cmake/Source -I/opt/cmake/cmake/Source/LexerParser -I/opt/cmake/cmake/Source/CTest -I/opt/cmake/cmake/Source/CPack -isystem /opt/cmake/cmake/Utilities/std -isystem /usr/include/jsoncpp -g -fdebug-prefix-map=/opt/cmake/cmake=. -Wformat -Werror=format-security -O3 -march=native -Wnon-virtual-dtor -Wcast-align -Wchar-subscripts -Wall -W -Wshadow -Wpointer-arith -Wformat-security -Wundef -O3 -DNDEBUG -Wno-deprecated-declarations -std=gnu++17 -o CMakeFiles/CMakeLib.dir/cmMakefileExecutableTargetGenerator.cxx.o -c /opt/cmake/cmake/Source/cmMakefileExecutableTargetGenerator.cxx
/opt/cmake/cmake/Source/cmMakefile.cxx: In member function ‘void cmMakefile::PrintCommandTrace(const cmListFileFunction&) const’:
/opt/cmake/cmake/Source/cmMakefile.cxx:337:55: error: conversion from ‘long int’ to ‘Json::Value’ is ambiguous
337 | val["line"] = static_cast<std::int64_t>(lff.Line);
| ^
In file included from /opt/cmake/cmake/Utilities/cm_jsoncpp_value.h:9,
from /opt/cmake/cmake/Source/cmMakefile.cxx:26:
/usr/include/jsoncpp/json/value.h:312:3: note: candidate: ‘Json::Value::Value(bool)’
312 | Value(bool value);
| ^~~~~
/usr/include/jsoncpp/json/value.h:289:3: note: candidate: ‘Json::Value::Value(double)’
289 | Value(double value);
| ^~~~~
/usr/include/jsoncpp/json/value.h:287:3: note: candidate: ‘Json::Value::Value(Json::Value::UInt64)’
287 | Value(UInt64 value);
| ^~~~~
/usr/include/jsoncpp/json/value.h:286:3: note: candidate: ‘Json::Value::Value(Json::Value::Int64)’
286 | Value(Int64 value);
| ^~~~~
/usr/include/jsoncpp/json/value.h:284:3: note: candidate: ‘Json::Value::Value(Json::Value::UInt)’
284 | Value(UInt value);
| ^~~~~
/usr/include/jsoncpp/json/value.h:283:3: note: candidate: ‘Json::Value::Value(Json::Value::Int)’
283 | Value(Int value);
| ^~~~~
/usr/include/jsoncpp/json/value.h:323:26: note: initializing argument 1 of ‘Json::Value& Json::Value::operator=(Json::Value)’
323 | Value& operator=(Value other);
| ~~~~~~^~~~~
/opt/cmake/cmake/Source/cmMakefile.cxx:345:69: error: conversion from ‘uint64_t’ {aka ‘long unsigned int’} to ‘Json::Value’ is ambiguous
345 | static_cast<std::uint64_t>(this->ExecutionStatusStack.size());
| ^
In file included from /opt/cmake/cmake/Utilities/cm_jsoncpp_value.h:9,
from /opt/cmake/cmake/Source/cmMakefile.cxx:26:
/usr/include/jsoncpp/json/value.h:312:3: note: candidate: ‘Json::Value::Value(bool)’
312 | Value(bool value);
| ^~~~~
/usr/include/jsoncpp/json/value.h:289:3: note: candidate: ‘Json::Value::Value(double)’
289 | Value(double value);
| ^~~~~
/usr/include/jsoncpp/json/value.h:287:3: note: candidate: ‘Json::Value::Value(Json::Value::UInt64)’
287 | Value(UInt64 value);
| ^~~~~
/usr/include/jsoncpp/json/value.h:286:3: note: candidate: ‘Json::Value::Value(Json::Value::Int64)’
286 | Value(Int64 value);
| ^~~~~
/usr/include/jsoncpp/json/value.h:284:3: note: candidate: ‘Json::Value::Value(Json::Value::UInt)’
284 | Value(UInt value);
| ^~~~~
/usr/include/jsoncpp/json/value.h:283:3: note: candidate: ‘Json::Value::Value(Json::Value::Int)’
283 | Value(Int value);
| ^~~~~
/usr/include/jsoncpp/json/value.h:323:26: note: initializing argument 1 of ‘Json::Value& Json::Value::operator=(Json::Value)’
323 | Value& operator=(Value other);
| ~~~~~~^~~~~
Environment:
- Debian Unstable
- g++ (Debian 9.2.1-25) 9.2.1 20200123