Open
Description
Clang format with the option RemoveParentheses
on MultipleParentheses
removes the parentheses in the snippet below.
MOCK_METHOD((int), func, ((std::map<int, int> )), (override));
becomes:
MOCK_METHOD((int), func, (std::map<int, int> ), (override));
With the parentheses, std::map<int, int>
is considered a single value for the macro. Without it, it becomes the values std::map<int
and int>
, both which are not a valid type.
I understand that clang-format is unable to know if this is a macro or a function call. The only thing that would give it away is fact that types are used instead of values. As such, we'll most likely need some option in the config file which indicates that a specific name maps to a macro.
Alternatively, it could detect the pattern < ... , ... >
.