Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: Apache Mesos does not build with clang due to c++11 errors. Version-Release number of selected component (if applicable): clang-3.4.2-1.el6.x86_64 How reproducible: 100% Steps to Reproduce: ./bootstrap ./configure Actual results: configure:19605: checking whether clang++ supports C++11 features with -std=c++11 configure:19666: clang++ -c -g1 -O0 -std=c++11 conftest.cpp >&5 In file included from conftest.cpp:23: In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/memory:67: In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/unique_ptr.h:41: /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/tuple:324:40: error: no matching function for call to 'forward' : _Inherited(std::forward<_U1>(__a1), std::forward<_U2>(__a2)) { } ^~~~~~~~~~~~~~~~~ /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/unique_ptr.h:104:9: note: in instantiation of function template specialization 'st d::tuple<Foo *, std::default_delete<Foo> >::tuple<Foo *&, std::default_delete<Foo> >' requested here : _M_t(__p, deleter_type()) ^ conftest.cpp:50:26: note: in instantiation of member function 'std::unique_ptr<Foo, std::default_delete<Foo> >::unique_ptr' requested here std::unique_ptr<Foo> p1(new Foo); // p1 owns Foo. ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:51:5: note: candidate function [with _Tp = std::default_delete<Foo>] not vi able: no known conversion from 'std::default_delete<Foo>' to 'typename std::identity<default_delete<Foo> >::type &&' (aka 'std::default_delete<Foo> &&') for 1st ar gument forward(typename std::identity<_Tp>::type&& __t) ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:57:14: error: rvalue reference to type 'unique_ptr<[2 * ...]>' cannot bind to lvalue of type 'unique_ptr<[2 * ...]>' { return __t; } ^~~ conftest.cpp:54:36: note: in instantiation of function template specialization 'std::move<std::unique_ptr<Foo, std::default_delete<Foo> > &>' requested here std::unique_ptr<Foo> p2(std::move(p1)); // Now p2 owns Foo. ^ In file included from conftest.cpp:23: In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/memory:67: /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/unique_ptr.h:121:29: error: no matching function for call to 'forward' : _M_t(__u.release(), std::forward<deleter_type>(__u.get_deleter())) { } ^~~~~~~~~~~~~~~~~~~~~~~~~~ conftest.cpp:54:28: note: in instantiation of member function 'std::unique_ptr<Foo, std::default_delete<Foo> >::unique_ptr' requested here std::unique_ptr<Foo> p2(std::move(p1)); // Now p2 owns Foo. ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:51:5: note: candidate function [with _Tp = std::default_delete<Foo>] not vi able: no known conversion from 'std::default_delete<Foo>' to 'typename std::identity<default_delete<Foo> >::type &&' (aka 'std::default_delete<Foo> &&') for 1st ar gument forward(typename std::identity<_Tp>::type&& __t) ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:57:14: error: rvalue reference to type 'default_delete<[...]>' cannot bind to lvalue of type 'default_delete<[...]>' { return __t; } ^~~ /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/unique_ptr.h:136:30: note: in instantiation of function template specialization 'std::move<std::default_delete<Foo> &>' requested here get_deleter() = std::move(__u.get_deleter()); ^ conftest.cpp:57:10: note: in instantiation of member function 'std::unique_ptr<Foo, std::default_delete<Foo> >::operator=' requested here p1 = std::move(p2); // Ownership returns to p1. ^ 4 errors generated. configure:19673: $? = 1 configure: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME "mesos" | #define PACKAGE_TARNAME "mesos" | #define PACKAGE_VERSION "0.22.0" | #define PACKAGE_STRING "mesos 0.22.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE "mesos" | #define VERSION "0.22.0" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | /* end confdefs.h. */ | | #include <memory> | | template <typename T, typename ...Args> | struct check | { | static_assert(sizeof(int) <= sizeof(T), "not big enough"); | }; | | typedef check<check<bool>> right_angle_brackets; | | int a; | decltype(a) b; | | typedef check<int> check_type; | check_type c; | check_type&& cr = static_cast<check_type&&>(c); | | auto d = a; | | struct Foo | { | void bar() const {} | }; | | void f(const Foo& foo) { foo.bar(); } | | void baz() { | std::unique_ptr<Foo> p1(new Foo); // p1 owns Foo. | p1->bar(); | | { | std::unique_ptr<Foo> p2(std::move(p1)); // Now p2 owns Foo. | f(*p2); | | p1 = std::move(p2); // Ownership returns to p1. | } | | p1->bar(); | } | configure:19691: result: no Expected results: Additional info: Mesos builds with clang 3.4 on Fedora 19.
The version of libstdc++ that comes with RHEL 6 only supports the limited features that gcc 4.4 supported at the time. So when you turn on the full C++11 support of clang it runs into problems. The only way to support C++11 with clang is to use devtoolset and so this is technically a duplicate of bug 1139077 and will be closed as such. *** This bug has been marked as a duplicate of bug 1139077 ***