(Hopefully) Fix Obj-C++ compilation of matchers

Thanks to bdb for the patch, related to #1661
This commit is contained in:
Martin Hořeňovský
2019-08-07 20:35:27 +02:00
parent 7a6af7ba76
commit 0ab11aa9b4
2 changed files with 14 additions and 5 deletions

View File

@@ -44,6 +44,15 @@ namespace Matchers {
virtual bool match( ObjectT const& arg ) const = 0;
};
#if defined(__OBJC__)
// Hack to fix Catch GH issue #1661. Could use id for generic Object support.
// use of const for Object pointers is very uncommon and under ARC it causes some kind of signature mismatch that breaks compilation
template<>
struct MatcherMethod<NSString*> {
virtual bool match( NSString* arg ) const = 0;
};
#endif
#ifdef __clang__
# pragma clang diagnostic pop
#endif