https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89793
Bug ID: 89793
Summary: Implicit conversion to std::string is ambiguous on GCC
8.2 but not GCC 7.3
Product: gcc
Version: 8.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: duyang.seu at gmail dot com
Target Milestone: ---
Created attachment 46006
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46006&action=edit
the preprocessed file
GCC Version:
gcc version 8.2.1 20180905 (Red Hat 8.2.1-3) (GCC)
System Type:
CentOS Linux release 7.5.1804 (Core)
GCC Configured options:
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-8/root/usr
--mandir=/opt/rh/devtoolset-8/root/usr/share/man
--infodir=/opt/rh/devtoolset-8/root/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --with-linker-hash-style=gnu
--with-default-libstdcxx-abi=gcc4-compatible --enable-plugin
--enable-initfini-array
--with-isl=/builddir/build/BUILD/gcc-8.2.1-20180905/obj-x86_64-redhat-linux/isl-install
--disable-libmpx --enable-gnu-indirect-function --with-tune=generic
--with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
Compilation errors:
message.cpp: In instantiation of ‘Message::Message(String&&) [with String =
StringType]’:
/opt/rh/devtoolset-8/root/usr/include/c++/8/ext/new_allocator.h:136:4:
required from ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...)
[with _Up = Message; _Args =
{StringType}; _Tp = Message]’
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/alloc_traits.h:475:4:
required from ‘static void std::allocator_traits
>::construct(std::allocator_traits >::allocator_type&, _Up*, _Args&& ...) [with _Up =
Message; _Args = {StringType}; _Tp = Message;
std::allocator_traits >::allocator_type
= std::allocator]’
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/shared_ptr_base.h:543:39:
required from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc,
_Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& .
..) [with _Args = {StringType}; _Tp = Message; _Alloc =
std::allocator; __gnu_cxx::_Lock_policy _Lp =
(__gnu_cxx::_Lock_policy)2]’
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/shared_ptr_base.h:656:4:
required from
‘std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const
_Alloc&, _A
rgs&& ...) [with _Tp = Message; _Alloc = std::allocator; _Args =
{StringType}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]’
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/shared_ptr_base.h:1322:35:
required from ‘std::__shared_ptr<_Tp,
_Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args
&& ...) [with _Alloc = std::allocator; _Args = {StringType}; _Tp =
Message; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]’
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/shared_ptr.h:360:64:
required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const
_Alloc&, _Args&& ...) [with _
Alloc = std::allocator; _Args = {StringType}; _Tp = Message]’
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/shared_ptr.h:706:14:
required from ‘std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&&
...) [with _Tp = Message; _Al
loc = std::allocator; _Args = {StringType}]’
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/shared_ptr.h:722:39:
required from ‘std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp =
Message; _Args = {StringType}]’
message.cpp:77:44: required from ‘void Queue::EnqueueImpl(T1&&, const
Queue::Type&) [with T1 = StringType; T2 = StringType; M = Message]’
message.cpp:63:5: required from ‘void Queue::Enqueue(T&&) [with T =
StringType; M = Message]’
message.cpp:86:29: required from here
message.cpp:47:60: error: call of overloaded ‘basic_string()’ is ambiguous
Message(String&& data) : data_{std::forward(data)} {}
^
In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/string:52,
from /usr/local/include/boost/utility/string_view_fwd.hpp:21,
from /usr/local/include/boost/utility/string_view.hpp:22,
from /usr/local/include/boost/beast/core/string.hpp:19,
from /usr/local/include/boost/beast/core/file_base.hpp:14,