[PATCH] D48632: ADT: Move ArrayRef comparison operators into the class

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 28 05:47:24 PDT 2018


labath added a comment.

I've had to revert this because it causes compilation errors on MSVC. I expected this could be a problem, though the error itself is rather puzzling:

  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xutility(2919): error C2893: Failed to specialize function template 'unknown-type std::equal_to<void>::operator ()(_Ty1 &&,_Ty2 &&) const'
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xutility(2919): note: With the following template arguments:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xutility(2919): note: '_Ty1=const llvm::MDOperand &'
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xutility(2919): note: '_Ty2=const llvm::MDOperand &'

So it MSVC is picking up this friend declaration (or at least, getting confused by it) even when neither of the types are ArrayRefs. That seems like a bug to me, though we may not be able to do anything about it.

(While working on this, I've also realized that I can use the `equals` member function to avoid explicit ArrayRef cast when I need to compare a ArrayRef with a different type).


Repository:
  rL LLVM

https://reviews.llvm.org/D48632





More information about the llvm-commits mailing list