Closed morbo84 closed 2 years ago
Do you have any example where it is required?
Sorry, false alarm!
@FranckRJ OK, let's start anew. 🙂
I'm hitting this compilation error with a specific compiler version (clang 8.0.1); in a first moment, I thought I was able to get rid of it without requiring changes to you, but that was not the case.
You can see that, adding the typename
keyword where I added in the PR, the compilation error is fixed.
I can add some details. The example is as simple as that:
struct Struct {};
struct Interface {
virtual Struct* foo() = 0;
virtual const Struct* foo() const = 0;
};
template<typename MyType>
void doStuff() {
auto actorMovementProxy = std::make_shared<fakeit::Mock<MyType>>();
fakeit::When(OverloadedMethod((*actorMovementProxy), foo, Struct * ())).AlwaysReturn(nullptr);
}
void boh() {
doStuff<Interface>();
}
Here you can find a live example of the failure; I've pasted the fakeit standalone header on top of my example and you can see that every version of clang (from 8.0.1 to current) and also GCC are failing to compile it, whereas MSVC doesn't complain (as usual). Adding the typename
keyword before MOCK_TYPE
's usages fixes the issue.
I'll look into it this weekend.
Under some scenarios, the
typename
keyword might be required.