[PATCH] D18061: Add iterator types to iterator_range, to appease newer gcc's

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 12 14:07:20 PST 2016

On Sat, Mar 12, 2016 at 11:31 AM, Dimitry Andric via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> dim abandoned this revision.
> dim added a comment.
> Okay, nevermind about this change.  In FreeBSD, I have simply imported
> http://reviews.llvm.org/rL255585 for now (a full libc++ import will
> follow later).  Gcc wanted to see `iterator` and `const_iterator` types in
> `iterator_range`, when `_LIBCPP_HAS_NO_TRAILING_RETURN` is defined, because
> libc++'s <iterator> then uses the following kind of definitions for e.g.
> `std::begin()`:
>   template <class _Cp>
>   typename _Cp::iterator
>   begin(_Cp& __c)
>   {
>       return __c.begin();
>   }
> E.g to be able to return anything, it needs to know the type.

Yeah, I'm pretty sure we require trailing return type for LLVM (I think we
have several explicit uses of it in the LLVM codebase) so it would be weird
for us to workaround non-standard features of the stdlib implementation
that only crop up only to work around non-conforming compilers that
wouldn't compile the rest of LLVM anyway.

Thanks for looking into/figuring out the issue!

- Dave

> http://reviews.llvm.org/D18061
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160312/0c9a6f6d/attachment.html>

More information about the llvm-commits mailing list