<div dir="rtl"><div dir="ltr">The namespace trick does not help since equal is visible to vector just the same it is to us. Below is the full error message. It would work without pulling equal out the namespace as llvm::algorithm::equal or llvm::alg::equal.</div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr">3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\vector(1800): error C2668: 'llvm::algorithm::equal' : ambiguous call to overloaded function (C:\llvm-clean\lib\TableGen\Record.cpp)</div><div dir="ltr">3>          C:\llvm-clean\include\llvm/ADT/STLExtras.h(377): could be 'bool llvm::algorithm::equal<std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<llvm::Init *>>>,std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<llvm::Init *>>>>(I1,I1,I2)' [found using argument-dependent lookup]</div><div dir="ltr">3>          with</div><div dir="ltr">3>          [</div><div dir="ltr">3>              I1=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<llvm::Init *>>></div><div dir="ltr">3>  ,            I2=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<llvm::Init *>>></div><div dir="ltr">3>          ]</div><div dir="ltr">3>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility(2792): or       'bool std::equal<std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<llvm::Init *>>>,std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<llvm::Init *>>>>(_InIt1,_InIt1,_InIt2)'</div><div dir="ltr">3>          with</div><div dir="ltr">3>          [</div><div dir="ltr">3>              _InIt1=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<llvm::Init *>>></div><div dir="ltr">3>  ,            _InIt2=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<llvm::Init *>>></div><div dir="ltr">3>          ]</div><div dir="ltr">3>          while trying to match the argument list '(std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<llvm::Init *>>>, std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<llvm::Init *>>>, std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<llvm::Init *>>>)'</div><div dir="ltr">3>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\vector(1808) : see reference to function template instantiation 'bool std::operator ==<llvm::Init*,std::allocator<_Ty>>(const std::vector<_Ty,std::allocator<_Ty>> &,const std::vector<_Ty,std::allocator<_Ty>> &)' being compiled</div><div dir="ltr">3>          with</div><div dir="ltr">3>          [</div><div dir="ltr">3>              _Ty=llvm::Init *</div><div dir="ltr">3>          ]</div><div dir="ltr">3>          C:\llvm-clean\lib\TableGen\Record.cpp(1511) : see reference to function template instantiation 'bool std::operator !=<llvm::Init*,std::allocator<_Ty>>(const std::vector<_Ty,std::allocator<_Ty>> &,const std::vector<_Ty,std::allocator<_Ty>> &)' being compiled</div><div dir="ltr">3>          with</div><div dir="ltr">3>          [</div><div dir="ltr">3>              _Ty=llvm::Init *</div><div dir="ltr">3>          ]</div><div><br></div></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2015-08-17 3:48 GMT+03:00 Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 2015-Aug-15, at 00:13, Justin Bogner <<a href="mailto:mail@justinbogner.com">mail@justinbogner.com</a>> wrote:<br>
><br>
> "Duncan P. N. Exon Smith" <<a href="mailto:dexonsmith@apple.com">dexonsmith@apple.com</a>> writes:<br>
>>> On 2015-Aug-12, at 12:22, Yaron Keren <<a href="mailto:yaron.keren@gmail.com">yaron.keren@gmail.com</a>> wrote:<br>
>>><br>
>><br>
</span><span class="">>>> 3) Should it replace the other uses of std:;equal in LLVM and clang,<br>
>>> although a nullptr is not possible in some (most?) of the code?<br>
>><br>
>> I'd say that's up to the MSVC folks (like you).  I wouldn't bother<br>
>> for iterators that aren't nullable, but for the others, it seems<br>
>> like it would be nice to have testcases to motivate the change?<br>
>> Possibly better in follow-up commits.<br>
><br>
> If we're adding an llvm::equal, we should probably just forbid<br>
> std::equal with the justification that it's broken on MSVC - having two<br>
> ways to do the same thing that are *usually* equivalent will invariably<br>
> result in people using the wrong one in the case where it matters.<br>
<br>
</span>Fair enough.<br>
</blockquote></div><br></div>