Issue 147780
Summary RemoveParentheses removes parentheses in macro call, resulting in , to no longer be escaped.
Labels new issue
Assignees
Reporter JVApen
    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 `< ... , ... >`.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to