[llvm] r243581 - Reapply "Add reverse(ContainerTy) range adapter."

Pete Cooper peter_cooper at apple.com
Wed Jul 29 17:48:05 PDT 2015


Should be fixed by r243581.  Sorry for the breakage.
> On Jul 29, 2015, at 5:41 PM, Charles Davis <cdavis5x at gmail.com> wrote:
> 
> 
>> On Jul 29, 2015, at 4:19 PM, Pete Cooper <peter_cooper at apple.com> wrote:
>> 
>> Author: pete
>> Date: Wed Jul 29 17:19:09 2015
>> New Revision: 243581
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=243581&view=rev
>> Log:
>> Reapply "Add reverse(ContainerTy) range adapter."
>> 
>> This reverts commit r243567, which ultimately reapplies r243563.
>> 
>> The fix here was to use std::enable_if for overload resolution.  Thanks to David
>> Blaikie for lots of help on this, and for the extra tests!
> Xcode 7 doesn’t like this:
> 
> ../lib/CodeGen/AsmPrinter/ARMException.cpp:118:32: error: no matching function for call to 'reverse'
>  for (const GlobalValue *GV : reverse(TypeInfos)) {
>                               ^~~~~~~
> ../include/llvm/ADT/STLExtras.h:210:38: note: candidate template ignored: disabled by 'enable_if' [with ContainerTy = const std::__1::vector<const llvm::GlobalValue *, std::__1::allocator<const llvm::GlobalValue *> > &]
>             typename std::enable_if<has_rbegin<ContainerTy>::value>::type * =
>                                     ^
> ../include/llvm/ADT/STLExtras.h:225:6: note: candidate template ignored: substitution failure [with ContainerTy = const std::__1::vector<const llvm::GlobalValue *, std::__1::allocator<const llvm::GlobalValue *> > &]: call to 'make_reverse_iterator' is ambiguous
> auto reverse(
>     ^
> /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:2343:1: note: candidate function template not viable: requires 2 arguments, but 1 was provided
> reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
> ^
> 1 error generated.
> 
> I’m pretty sure `std::vector` has an `rbegin()` method, so there must be something about your `has_rbegin` metafunction predicate that XC7 Clang doesn’t like. My own investigations seem to suggest that it has something to do with the fact that `std::vector::rbegin()` is overloaded with respect to `const`.
> 
> Chip
> 





More information about the llvm-commits mailing list