Skip to content
This repository has been archived by the owner on Jul 17, 2019. It is now read-only.

Compilation error: #219

Open
ArthurBlondel opened this issue Dec 25, 2018 · 0 comments
Open

Compilation error: #219

ArthurBlondel opened this issue Dec 25, 2018 · 0 comments

Comments

@ArthurBlondel
Copy link

class FatherClass {
public:
int field;
...
};

class SonClass : public FatherClass {
...
};

class SomeClass {
virtual int m_service(FatherClass*){};
};

class MockSomeClass : public SomeClass {
MOCK_METHOD1(m_service, int(FatherClass*));
};

int main(void) {
MockSomeClass object;

EXPECT_CALL(object, m_service(AllOf(Field(&SonClass::field, 5))))
    .Times(1);

...

}

Compilation error:
error: invalid conversion from ‘FatherClass*’ to ‘const SonClass*’ [-fpermissive]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant