Skip to content

cmMakefileProfilingData: Fix ambiguous conversion to Json::Value

Raul Tambre requested to merge tambre/cmake:mf_profiling_json into master
/opt/package/cmake/Source/cmMakefileProfilingData.cxx:64:15: error: conversion from 'uint64_t' (aka 'unsigned long') to 'Json::Value' is ambiguous
    v["ts"] = uint64_t(std::chrono::duration_cast<std::chrono::microseconds>(
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/jsoncpp/json/value.h:283:3: note: candidate constructor
  Value(Int value);
  ^
/usr/include/jsoncpp/json/value.h:284:3: note: candidate constructor
  Value(UInt value);
  ^
/usr/include/jsoncpp/json/value.h:286:3: note: candidate constructor
  Value(Int64 value);
  ^
/usr/include/jsoncpp/json/value.h:287:3: note: candidate constructor
  Value(UInt64 value);
  ^
/usr/include/jsoncpp/json/value.h:289:3: note: candidate constructor
  Value(double value);
  ^
/usr/include/jsoncpp/json/value.h:312:3: note: candidate constructor
  Value(bool value);
  ^
/usr/include/jsoncpp/json/value.h:323:26: note: passing argument to parameter 'other' here
  Value& operator=(Value other);
                         ^
/opt/package/cmake/Source/cmMakefileProfilingData.cxx:101:15: error: conversion from 'uint64_t' (aka 'unsigned long') to 'Json::Value' is ambiguous
    v["ts"] = uint64_t(std::chrono::duration_cast<std::chrono::microseconds>(
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/jsoncpp/json/value.h:283:3: note: candidate constructor
  Value(Int value);
  ^
/usr/include/jsoncpp/json/value.h:284:3: note: candidate constructor
  Value(UInt value);
  ^
/usr/include/jsoncpp/json/value.h:286:3: note: candidate constructor
  Value(Int64 value);
  ^
/usr/include/jsoncpp/json/value.h:287:3: note: candidate constructor
  Value(UInt64 value);
  ^
/usr/include/jsoncpp/json/value.h:289:3: note: candidate constructor
  Value(double value);
  ^
/usr/include/jsoncpp/json/value.h:312:3: note: candidate constructor
  Value(bool value);
  ^
/usr/include/jsoncpp/json/value.h:323:26: note: passing argument to parameter 'other' here
  Value& operator=(Value other);
                         ^

Merge request reports