Skip to content

macros don't support noexcept #48

Description

@sebkraemer

We have some methods which are declared noexcept. Currently, we used proxy methods to work around this. Is there another way? Is there an interest in adding it to the existing function macros list?

A colleague hacked together a macro like this:

#define MOCK_NOEXCEPT_OVERRIDE_METHOD_EXT(M, n, S, t)
MOCK_METHOD_AUX(M, n, S, t, noexcept override,)
MOCK_METHOD_AUX(M, n, S, t, const noexcept override,)
MOCK_METHOD_HELPER(S, t,)
#define MOCK_CONST_NOEXCEPT_OVERRIDE_METHOD_EXT(M, n, S, t)
MOCK_METHOD_AUX(M, n, S, t, const noexcept override,)
MOCK_METHOD_HELPER(S, t,)
#define MOCK_NON_CONST_NOEXCEPT_OVERRIDE_METHOD_EXT(M, n, S, t)
MOCK_METHOD_AUX(M, n, S, t, noexcept override,)
MOCK_METHOD_HELPER(S, t,)

and alike (without _EXT).

Some goes for missing override, which only pops an IDE warning but would also be nice to have.

The whole solution would need the zoo of combinations with const, nonconst, explicit override and so on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions