Merge branch 'develop' into feature/issue260
This commit is contained in:
commit
494cc15650
3 changed files with 81 additions and 50 deletions
97
.travis.yml
97
.travis.yml
|
@ -44,6 +44,21 @@ matrix:
|
||||||
branch_pattern: coverity_scan
|
branch_pattern: coverity_scan
|
||||||
env: COMPILER=g++-5
|
env: COMPILER=g++-5
|
||||||
|
|
||||||
|
# from https://github.com/travis-ci/travis-ci/issues/6120
|
||||||
|
- os: linux
|
||||||
|
env:
|
||||||
|
- LLVM_VERSION=3.8.0
|
||||||
|
- LLVM_ARCHIVE_PATH=$HOME/clang+llvm.tar.xz
|
||||||
|
- COMPILER=clang++
|
||||||
|
- CPPFLAGS="-I $HOME/clang-$LLVM_VERSION/include/c++/v1"
|
||||||
|
- CXXFLAGS=-lc++
|
||||||
|
- PATH=$HOME/clang-$LLVM_VERSION/bin:$PATH
|
||||||
|
- LD_LIBRARY_PATH=$HOME/clang-$LLVM_VERSION/lib:$LD_LIBRARY_PATH
|
||||||
|
before_install:
|
||||||
|
- wget http://llvm.org/releases/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-14.04.tar.xz -O $LLVM_ARCHIVE_PATH
|
||||||
|
- mkdir $HOME/clang-$LLVM_VERSION
|
||||||
|
- tar xf $LLVM_ARCHIVE_PATH -C $HOME/clang-$LLVM_VERSION --strip-components 1
|
||||||
|
|
||||||
# - os: linux
|
# - os: linux
|
||||||
# compiler: gcc
|
# compiler: gcc
|
||||||
# addons:
|
# addons:
|
||||||
|
@ -55,29 +70,29 @@ matrix:
|
||||||
# Clang 3.5 is not able to compile the code,
|
# Clang 3.5 is not able to compile the code,
|
||||||
# see https://travis-ci.org/nlohmann/json/jobs/126720186
|
# see https://travis-ci.org/nlohmann/json/jobs/126720186
|
||||||
|
|
||||||
- os: linux
|
# - os: linux
|
||||||
compiler: clang
|
# compiler: clang
|
||||||
addons:
|
# addons:
|
||||||
apt:
|
# apt:
|
||||||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
|
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
|
||||||
packages: ['clang-3.6', 'valgrind']
|
# packages: ['clang-3.6', 'valgrind']
|
||||||
env: COMPILER=clang++-3.6
|
# env: COMPILER=clang++-3.6
|
||||||
|
#
|
||||||
- os: linux
|
# - os: linux
|
||||||
compiler: clang
|
# compiler: clang
|
||||||
addons:
|
# addons:
|
||||||
apt:
|
# apt:
|
||||||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
|
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
|
||||||
packages: ['clang-3.7', 'valgrind']
|
# packages: ['clang-3.7', 'valgrind']
|
||||||
env: COMPILER=clang++-3.7
|
# env: COMPILER=clang++-3.7
|
||||||
|
#
|
||||||
- os: linux
|
# - os: linux
|
||||||
compiler: clang
|
# compiler: clang
|
||||||
addons:
|
# addons:
|
||||||
apt:
|
# apt:
|
||||||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8']
|
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8']
|
||||||
packages: ['clang-3.8', 'valgrind']
|
# packages: ['clang-3.8', 'valgrind']
|
||||||
env: COMPILER=clang++-3.8
|
# env: COMPILER=clang++-3.8
|
||||||
|
|
||||||
# - os: linux
|
# - os: linux
|
||||||
# compiler: clang
|
# compiler: clang
|
||||||
|
@ -90,42 +105,56 @@ matrix:
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: beta-xcode6.1
|
osx_image: beta-xcode6.1
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: COMPILER=clang
|
env:
|
||||||
|
- COMPILER=clang
|
||||||
|
- CXXFLAGS=-lstdc++
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: beta-xcode6.2
|
osx_image: beta-xcode6.2
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: COMPILER=clang
|
env:
|
||||||
|
- COMPILER=clang
|
||||||
|
- CXXFLAGS=-lstdc++
|
||||||
|
|
||||||
# - os: osx
|
- os: osx
|
||||||
# osx_image: beta-xcode6.3
|
osx_image: beta-xcode6.3
|
||||||
# compiler: clang
|
compiler: clang
|
||||||
# env: COMPILER=clang
|
env:
|
||||||
|
- COMPILER=clang
|
||||||
|
- CXXFLAGS=-lstdc++
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode6.4
|
osx_image: xcode6.4
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: COMPILER=clang
|
env:
|
||||||
|
- COMPILER=clang
|
||||||
|
- CXXFLAGS=-lstdc++
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode7.1
|
osx_image: xcode7.1
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: COMPILER=clang
|
env:
|
||||||
|
- COMPILER=clang
|
||||||
|
- CXXFLAGS=-lstdc++
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode7.2
|
osx_image: xcode7.2
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: COMPILER=clang
|
env:
|
||||||
|
- COMPILER=clang
|
||||||
|
- CXXFLAGS=-lstdc++
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode7.3
|
osx_image: xcode7.3
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: COMPILER=clang
|
env:
|
||||||
|
- COMPILER=clang
|
||||||
|
- CXXFLAGS=-lstdc++
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- uname -a
|
- uname -a
|
||||||
- $COMPILER --version
|
- $COMPILER --version
|
||||||
- make CXX=$COMPILER CXXFLAGS="-lstdc++"
|
- make CXX=$COMPILER
|
||||||
- ./json_unit "*"
|
- ./json_unit "*"
|
||||||
- if [ `which valgrind` ]; then
|
- if [ `which valgrind` ]; then
|
||||||
valgrind --error-exitcode=1 --leak-check=full ./json_unit ;
|
valgrind --error-exitcode=1 --leak-check=full ./json_unit ;
|
||||||
|
|
17
src/json.hpp
17
src/json.hpp
|
@ -1461,13 +1461,13 @@ class basic_json
|
||||||
|
|
||||||
@since version 2.0.0
|
@since version 2.0.0
|
||||||
*/
|
*/
|
||||||
template < typename CompatibleNumberUnsignedType, typename
|
template <typename CompatibleNumberUnsignedType, typename
|
||||||
std::enable_if <
|
std::enable_if <
|
||||||
std::is_constructible<number_unsigned_t, CompatibleNumberUnsignedType>::value and
|
std::is_constructible<number_unsigned_t, CompatibleNumberUnsignedType>::value and
|
||||||
std::numeric_limits<CompatibleNumberUnsignedType>::is_integer and
|
std::numeric_limits<CompatibleNumberUnsignedType>::is_integer and
|
||||||
!std::numeric_limits<CompatibleNumberUnsignedType>::is_signed,
|
not std::numeric_limits<CompatibleNumberUnsignedType>::is_signed,
|
||||||
CompatibleNumberUnsignedType >::type
|
CompatibleNumberUnsignedType>::type
|
||||||
= 0 >
|
= 0>
|
||||||
basic_json(const CompatibleNumberUnsignedType val) noexcept
|
basic_json(const CompatibleNumberUnsignedType val) noexcept
|
||||||
: m_type(value_t::number_unsigned),
|
: m_type(value_t::number_unsigned),
|
||||||
m_value(static_cast<number_unsigned_t>(val))
|
m_value(static_cast<number_unsigned_t>(val))
|
||||||
|
@ -5079,6 +5079,7 @@ class basic_json
|
||||||
throw std::domain_error("iterator does not fit current value");
|
throw std::domain_error("iterator does not fit current value");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if range iterators belong to the same JSON object
|
||||||
if (first.m_object != last.m_object)
|
if (first.m_object != last.m_object)
|
||||||
{
|
{
|
||||||
throw std::domain_error("iterators do not fit");
|
throw std::domain_error("iterators do not fit");
|
||||||
|
@ -7332,7 +7333,7 @@ class basic_json
|
||||||
|
|
||||||
@return string representation of the code point
|
@return string representation of the code point
|
||||||
|
|
||||||
@throw std::out_of_range if code point is >0x10ffff; example: `"code
|
@throw std::out_of_range if code point is > 0x10ffff; example: `"code
|
||||||
points above 0x10FFFF are invalid"`
|
points above 0x10FFFF are invalid"`
|
||||||
@throw std::invalid_argument if the low surrogate is invalid; example:
|
@throw std::invalid_argument if the low surrogate is invalid; example:
|
||||||
`""missing or wrong low surrogate""`
|
`""missing or wrong low surrogate""`
|
||||||
|
|
|
@ -1461,13 +1461,13 @@ class basic_json
|
||||||
|
|
||||||
@since version 2.0.0
|
@since version 2.0.0
|
||||||
*/
|
*/
|
||||||
template < typename CompatibleNumberUnsignedType, typename
|
template <typename CompatibleNumberUnsignedType, typename
|
||||||
std::enable_if <
|
std::enable_if <
|
||||||
std::is_constructible<number_unsigned_t, CompatibleNumberUnsignedType>::value and
|
std::is_constructible<number_unsigned_t, CompatibleNumberUnsignedType>::value and
|
||||||
std::numeric_limits<CompatibleNumberUnsignedType>::is_integer and
|
std::numeric_limits<CompatibleNumberUnsignedType>::is_integer and
|
||||||
!std::numeric_limits<CompatibleNumberUnsignedType>::is_signed,
|
not std::numeric_limits<CompatibleNumberUnsignedType>::is_signed,
|
||||||
CompatibleNumberUnsignedType >::type
|
CompatibleNumberUnsignedType>::type
|
||||||
= 0 >
|
= 0>
|
||||||
basic_json(const CompatibleNumberUnsignedType val) noexcept
|
basic_json(const CompatibleNumberUnsignedType val) noexcept
|
||||||
: m_type(value_t::number_unsigned),
|
: m_type(value_t::number_unsigned),
|
||||||
m_value(static_cast<number_unsigned_t>(val))
|
m_value(static_cast<number_unsigned_t>(val))
|
||||||
|
@ -5079,6 +5079,7 @@ class basic_json
|
||||||
throw std::domain_error("iterator does not fit current value");
|
throw std::domain_error("iterator does not fit current value");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if range iterators belong to the same JSON object
|
||||||
if (first.m_object != last.m_object)
|
if (first.m_object != last.m_object)
|
||||||
{
|
{
|
||||||
throw std::domain_error("iterators do not fit");
|
throw std::domain_error("iterators do not fit");
|
||||||
|
@ -7332,7 +7333,7 @@ class basic_json
|
||||||
|
|
||||||
@return string representation of the code point
|
@return string representation of the code point
|
||||||
|
|
||||||
@throw std::out_of_range if code point is >0x10ffff; example: `"code
|
@throw std::out_of_range if code point is > 0x10ffff; example: `"code
|
||||||
points above 0x10FFFF are invalid"`
|
points above 0x10FFFF are invalid"`
|
||||||
@throw std::invalid_argument if the low surrogate is invalid; example:
|
@throw std::invalid_argument if the low surrogate is invalid; example:
|
||||||
`""missing or wrong low surrogate""`
|
`""missing or wrong low surrogate""`
|
||||||
|
|
Loading…
Reference in a new issue