[Testing/Support] Make Failed() matcher work with abstract error types

Failed<ErrorInfoBase>() did not compile, because it was attempting to
create a copy of the Error object when passing it to the nested matcher,
which was not possible because ErrorInfoBase is abstract.

This commit fixes the problem by making sure we pass the ErrorInfo
object by reference, which also improves the handling of non-abstract
objects, as we avoid potentially slicing an object during the copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329703 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed