diff --git a/include/boost/endian/buffers.hpp b/include/boost/endian/buffers.hpp index 890919b..829d18b 100644 --- a/include/boost/endian/buffers.hpp +++ b/include/boost/endian/buffers.hpp @@ -290,7 +290,7 @@ namespace endian { T t; std::memcpy( &t, bytes, sizeof(T) ); - return endian::big_to_native(t); + return boost::endian::big_to_native(t); } # endif return unrolled_byte_loops::load_big @@ -324,7 +324,7 @@ namespace endian // (the x86 architecture allows unaligned loads, but -fsanitize=undefined does not) if (sizeof(T) == n_bytes) { - endian::native_to_big_inplace(value); + boost::endian::native_to_big_inplace(value); std::memcpy( bytes, &value, sizeof(T) ); return; } diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 3b12793..47ca215 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -43,3 +43,5 @@ run conversion_test.cpp : : : BOOST_ENDIAN_NO_INTRINSICS : conversion_te run intrinsic_test.cpp ; run quick.cpp ; + +compile spirit_conflict_test.cpp ; diff --git a/test/spirit_conflict_test.cpp b/test/spirit_conflict_test.cpp new file mode 100644 index 0000000..dc2c7c3 --- /dev/null +++ b/test/spirit_conflict_test.cpp @@ -0,0 +1,23 @@ +// Copyright 2019 Peter Dimov +// +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt + +#if defined(_MSC_VER) +# pragma warning( disable: 4510 ) // default constructor not generated +# pragma warning( disable: 4512 ) // assignment operator not generated +# pragma warning( disable: 4610 ) // class can never be instantiated +#endif + +#include +#include + +struct record +{ + boost::endian::big_int16_t type; + + record( boost::int16_t t ) + { + type = t; + } +};