Date: Fri, 21 Aug 2020 04:32:14 +0000 From: bugzilla-noreply@freebsd.org To: toolchain@FreeBSD.org Subject: maintainer-feedback requested: [Bug 248795] std::random_shuffle broken with LLVM11 Message-ID: <bug-248795-29464-xABOxH7rx6@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-248795-29464@https.bugs.freebsd.org/bugzilla/> References: <bug-248795-29464@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
Tobias Kortkamp <tobik@freebsd.org> has asked freebsd-toolchain (Nobody) <toolchain@FreeBSD.org> for maintainer-feedback: Bug 248795: std::random_shuffle broken with LLVM11 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D248795 --- Description --- The following example no longer compiles after the LLVM11 import. This affects a number of ports like x11/workrave, www/newsboat, japanese/zinnia, ... I can patch them to use shuffle instead, but even though random_shuffle is deprecated it should still work, right? $ cat foo.cc #include <algorithm> #include <vector> int main() { std::vector<int> v =3D {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; std::random_shuffle(v.begin(), v.end()); } $ c++ foo.cc foo.cc:7:10: warning: 'random_shuffle<std::__1::__wrap_iter<int *>>' is deprecated [-Wdeprecated-declarations] std::random_shuffle(v.begin(), v.end()); ^ /usr/include/c++/v1/algorithm:3095:1: note: 'random_shuffle<std::__1::__wrap_iter<int *>>' has been explicitly marked deprecated here _LIBCPP_DEPRECATED_IN_CXX14 void ^ /usr/include/c++/v1/__config:991:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX14' # define _LIBCPP_DEPRECATED_IN_CXX14 _LIBCPP_DEPRECATED ^ /usr/include/c++/v1/__config:974:48: note: expanded from macro '_LIBCPP_DEPRECATED' # define _LIBCPP_DEPRECATED __attribute__ ((deprecated)) ^ 1 warning generated. ld: error: undefined symbol: std::__1::__rs_get() >>> referenced by foo.cc >>> /tmp/foo-6a4153.o:(void std::__1::random_shuffle<std::__1::__wrap_iter<int*> >(std::__1::__wrap_iter<int*>, std::__1::__wrap_iter<int*>)) ld: error: undefined symbol: std::__1::__rs_default::~__rs_default() >>> referenced by foo.cc >>> /tmp/foo-6a4153.o:(void std::__1::random_shuffle<std::__1::__wrap_iter<int*> >(std::__1::__wrap_iter<int*>, std::__1::__wrap_iter<int*>)) >>> referenced by foo.cc >>> /tmp/foo-6a4153.o:(void std::__1::random_shuffle<std::__1::__wrap_iter<int*> >(std::__1::__wrap_iter<int*>, std::__1::__wrap_iter<int*>)) ld: error: undefined symbol: std::__1::__rs_default::operator()() >>> referenced by foo.cc >>>=09=09=20 /tmp/foo-6a4153.o:(std::__1::__independent_bits_engine<std::__1::__rs_defau= lt, unsigned long>::__eval(std::__1::integral_constant<bool, true>)) >>> referenced by foo.cc >>>=09=09=20 /tmp/foo-6a4153.o:(std::__1::__independent_bits_engine<std::__1::__rs_defau= lt, unsigned long>::__eval(std::__1::integral_constant<bool, true>)) c++: error: linker command failed with exit code 1 (use -v to see invocatio= n)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-248795-29464-xABOxH7rx6>