Re: RFT: Please help testing the llvm/clang 3.5.0 import

From: Dmitry Marakasov <amdmi3_at_amdmi3.ru>
Date: Sun, 30 Nov 2014 21:57:30 +0300
* Dimitry Andric (dim_at_FreeBSD.org) wrote:

> We're working on updating llvm, clang and lldb to 3.5.0 in head.
> This is quite a big update again, and any help with testing is
> appreciated.

Well, of 4 error logs from exp-run I've checked (one my port and 3
unmaintained ports) two had basically the same problem and it seems
to be libc++ related, so I ask: was new version of libc++ imported
along with clang/llvm? Past experience show that libc++ should be
updated along with clang, as it may have bugs new clang versions
are not tolerable to.

I've prepared the minimal test program to demonstrate the problem:

--- test.cc begins here ---
#include <functional>
#include <iostream>

class Foo {
public:
	void Const() const { std::cerr << "OK" << std::endl; }
};

int main() {
	Foo foo;
	auto f = std::bind(&Foo::Const, foo);
	f();

	return 0;
}
--- test.cc ends here ---

Note that the method std::bind is used on is const (non-const methods
produce no problems). 

Here's how it works:

--- test.log begins here ---
% for CC in c++ g++48 g++49 g++5 clang++33 clang++34 clang++35; do echo "===> ${CC}"; ${CC} -std=c++11 test.cc && ./a.out; done
===> c++
OK
===> g++48
OK
===> g++49
OK
===> g++5
OK
===> clang++33
OK
===> clang++34
OK
===> clang++35
In file included from test.cc:1:
In file included from /usr/include/c++/v1/functional:474:
/usr/include/c++/v1/type_traits:433:76: error: no matching function for call to '__source'
    : public integral_constant<bool, sizeof(__is_function_imp::__test<_Tp>(__is_function_imp::__source<_Tp>())) == 1>
                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/type_traits:438:14: note: in instantiation of template class 'std::__1::__libcpp_is_function<void () const, false>' requested here
    : public __libcpp_is_function<_Tp> {};
             ^
/usr/include/c++/v1/type_traits:443:97: note: in instantiation of template class 'std::__1::is_function<void () const>' requested here
template <class _Tp, class _Up> struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {};
                                                                                                ^
/usr/include/c++/v1/type_traits:446:14: note: in instantiation of template class 'std::__1::__libcpp_is_member_function_pointer<void (Foo::*)() const>' requested here
    : public __libcpp_is_member_function_pointer<typename remove_cv<_Tp>::type> {};
             ^
/usr/include/c++/v1/type_traits:460:38: note: in instantiation of template class 'std::__1::is_member_function_pointer<void (Foo::*)() const>' requested here
                                    !is_member_function_pointer<_Tp>::value> {};
                                     ^
/usr/include/c++/v1/type_traits:3093:17: note: in instantiation of template class 'std::__1::is_member_object_pointer<void (Foo::*)() const>' requested here
                is_member_object_pointer<typename remove_reference<_Fp>::type>::value &&
                ^
/usr/include/c++/v1/type_traits:3100:1: note: (skipping 2 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
__invoke(_Fp&& __f, _A0&& __a0)
^
/usr/include/c++/v1/type_traits:3126:11: note: in instantiation of template class 'std::__1::__invokable_imp<void (Foo::*)() const, Foo &>' requested here
          __invokable_imp<_Fp, _Args...>::value>
          ^
/usr/include/c++/v1/functional:1973:31: note: in instantiation of template class 'std::__1::__invokable<void (Foo::*)() const, Foo &>' requested here
    static const bool value = __invokable<_Fp,
                              ^
/usr/include/c++/v1/functional:1985:18: note: in instantiation of template class 'std::__1::_is_valid_bind_return<void (Foo::*)() const, std::__1::tuple<Foo>, std::__1::tuple<> >' requested here
          bool = _is_valid_bind_return<_Fp, _BoundArgs, _TupleUj>::value>
                 ^
/usr/include/c++/v1/functional:2082:18: note: in instantiation of default argument for '__bind_return<void (Foo::*)() const, std::__1::tuple<Foo>, std::__1::tuple<> >' required here
        typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.cc:12:3: note: while substituting deduced template arguments into function template 'operator()' [with _Args = <>]
        f();
         ^
/usr/include/c++/v1/type_traits:424:28: note: candidate template ignored: substitution failure [with _Tp = void () const]: reference to function type 'void () const' cannot have 'const' qualifier
template <class _Tp> _Tp&  __source();
                     ~~~   ^
test.cc:12:2: error: no matching function for call to object of type 'std::__1::__bind<void (Foo::*)() const, Foo &>'
        f();
        ^
/usr/include/c++/v1/functional:2083:9: note: candidate template ignored: substitution failure [with _Args = <>]: implicit instantiation of undefined template 'std::__1::__bind_return<void (Foo::*)() const, std::__1::tuple<Foo>, std::__1::tuple<>, false>'
        operator()(_Args&& ...__args)
        ^
/usr/include/c++/v1/functional:2092:9: note: candidate template ignored: substitution failure [with _Args = <>]: implicit instantiation of undefined template 'std::__1::__bind_return<void (Foo::*const)() const, const std::__1::tuple<Foo>, std::__1::tuple<>, false>'
        operator()(_Args&& ...__args) const
        ^
2 errors generated.
--- test.log ends here ---

I think this should be fixed in the first place.

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3_at_amdmi3.ru  ..:  jabber: amdmi3_at_jabber.ru    http://www.amdmi3.ru
Received on Sun Nov 30 2014 - 17:57:41 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:54 UTC