https://llvm.org/bugs/show_bug.cgi?id=28927
Bug ID: 28927 Summary: <iterator> free cbegin/cend crbegin/crend erroneous ADL begin/end rbegin/rend Product: libc++ Version: 3.9 Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: All Bugs Assignee: unassignedclangb...@nondot.org Reporter: e...@catmur.co.uk CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com Classification: Unclassified #include <iterator> #include <type_traits> struct S {}; int begin(S); template<class T> std::true_type has_cbegin(decltype(std::cbegin(T{}))); template<class T> std::false_type has_cbegin(...); static_assert(!decltype(has_cbegin<S>(0))::value); Libc++ cbegin etc. call the corresponding non-const free functions unqualified, so performing ADL: template <class _Cp> inline _LIBCPP_INLINE_VISIBILITY auto cbegin(const _Cp& __c) -> decltype(begin(__c)) { return begin(__c); } This is contrary to [iterator.range] (per C++14 and up to n6406) which specifies that std::begin is called qualified. libstdc++ gets this right. Also correct in libc++ <iterator> synopsis. From: http://stackoverflow.com/questions/38878454/clang-vs-gcc-stdcrbegin-with-boostiterator-range -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs