Skip to content

Commit

Permalink
Unbreak optional specifiers for trailing return type syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
rollbear committed Mar 11, 2024
1 parent 7554674 commit 113fed5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/trompeloeil/mock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ namespace trompeloeil { using std::unique_lock; }
#define TROMPELOEIL_APPLY(m, ...) TROMPELOEIL_IDENTITY(m(__VA_ARGS__))
#define TROMPELOEIL_COUNT_AND_COMMA(...) TROMPELOEIL_COUNT(__VA_ARGS__),

#define TROMPELOEIL_ARG_COUNT(sig) TROMPELOEIL_APPLY(TROMPELOEIL_HEAD, TROMPELOEIL_COUNT_AND_COMMA sig)
#define TROMPELOEIL_ARG_COUNT(...) TROMPELOEIL_APPLY(TROMPELOEIL_HEAD, TROMPELOEIL_COUNT_AND_COMMA __VA_ARGS__)

#define TROMPELOEIL_PARAMS(num) TROMPELOEIL_CONCAT(TROMPELOEIL_PARAMS, num)

Expand Down
10 changes: 8 additions & 2 deletions test/compiling_tests_11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5938,9 +5938,15 @@ TEST_CASE_METHOD(

#if not TROMPELOEIL_GCC or TROMPELOEIL_GCC_VERSION >= 50000

struct trailing_syntax_mock
struct trailing_syntax_base
{
MAKE_MOCK(func, (int x, int y)->int);
virtual ~trailing_syntax_base() = default;
virtual auto func(int,int)->int = 0;
};

struct trailing_syntax_mock : trailing_syntax_base
{
MAKE_MOCK(func, (int x, int y)->int, override final);
MAKE_MOCK(func, (int x)->int);
MAKE_CONST_MOCK(func, (int x)->int);
};
Expand Down

0 comments on commit 113fed5

Please sign in to comment.