Fix reverse to work on const rbegin()/rend().
authorPete Cooper <peter_cooper@apple.com>
Wed, 17 Aug 2016 22:06:59 +0000 (22:06 +0000)
committerPete Cooper <peter_cooper@apple.com>
Wed, 17 Aug 2016 22:06:59 +0000 (22:06 +0000)
commit0041888aea503b0a3c08ecf5ca59ea10f6244c5b
tree8c45f1ad6fcc6976517c4e3af1e984d86a57859f
parent9074341618644ad226e95618be2f95b305c1b4ac
Fix reverse to work on const rbegin()/rend().

Duncan found that reverse worked on mutable rbegin(), but the has_rbegin
trait didn't work with a const method.  See http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160815/382890.html
for more details.

Turns out this was already solved in clang with has_getDecl.  Copied that and made it work for rbegin.

This includes the tests Duncan attached to that thread, including the traits test.

llvm-svn: 278991
llvm/include/llvm/ADT/STLExtras.h
llvm/unittests/ADT/RangeAdapterTest.cpp