<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/95955>95955</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Clang Tidy] `bugprone-macro-parentheses` should not trigger for function prototypes (which C++ does not allow to nest parenthesis)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ETERNALBLUEbullrun
      </td>
    </tr>
</table>

<pre>
    ```
   27 | typedef class Cns {
      |               ^
   28 | public:
      |
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:44:9: warning: function-like macro 'templateWorkaround' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
   44 | #define templateWorkaround(INPUT_MODE, INPUT_TYPEDEF) \
      |         ^
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:58:35: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
   58 |         virtual const bool processToBool(INPUT_TYPEDEF &input) const {assert((INPUT_MODE) == inputMode && cnsModeBool == outputMode); return 0;}\
      |                                          ^
      |                                          (            )
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:59:35: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
   59 |         virtual const char processToChar(INPUT_TYPEDEF &input) const {assert((INPUT_MODE) == inputMode && cnsModeChar == outputMode); return 0;}\
      |                                          ^
      |                                          (            )
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:60:33: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
   60 |         virtual const int processToInt(INPUT_TYPEDEF &input) const {assert((INPUT_MODE) == inputMode && cnsModeInt == outputMode); return 0;}\
      |                                        ^
      |                                        (            )
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:61:43: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
   61 |         virtual const unsigned int processToUint(INPUT_TYPEDEF &input) const {assert((INPUT_MODE) == inputMode && cnsModeUint == outputMode); return 0;}\
      |                                                  ^
      |                                                  (            )
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:62:37: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
   62 |         virtual const float processToFloat(INPUT_TYPEDEF &input) const {assert((INPUT_MODE) == inputMode && cnsModeFloat == outputMode); return 0;}\
      |                                            ^
      |                                            (            )
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:63:39: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
   63 |         virtual const double processToDouble(INPUT_TYPEDEF &input) const {assert((INPUT_MODE) == inputMode && cnsModeDouble == outputMode); return 9;}\
      |                                              ^
      |                                              (            )
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:64:54: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
   64 |         virtual const std::vector<bool> processToVectorBool(INPUT_TYPEDEF &input) const {assert((INPUT_MODE) == inputMode && cnsModeVectorBool == outputMode); return {};}\
      |                                                             ^
      |                                                             (            )
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:65:54: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
   65 |         virtual const std::vector<char> processToVectorChar(INPUT_TYPEDEF &input) const {assert((INPUT_MODE) == inputMode && cnsModeVectorChar == outputMode); return {};}\
      |                                                             ^
      |                                                             (            )
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:66:52: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
   66 |         virtual const std::vector<int> processToVectorInt(INPUT_TYPEDEF &input) const {assert((INPUT_MODE) == inputMode && cnsModeVectorInt == outputMode); return {};}\
      |                                                           ^
      |                                                           (            )
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:67:62: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
   67 |         virtual const std::vector<unsigned int> processToVectorUint(INPUT_TYPEDEF &input) const {assert((INPUT_MODE) == inputMode && cnsModeVectorUint == outputMode); return {};}\
      |                                                                     ^
      |                                                                     (            )
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:68:50: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
   68 |         virtual std::vector<float> processToVectorFloat(INPUT_TYPEDEF &input) const {assert((INPUT_MODE) == inputMode && cnsModeVectorFloat == outputMode); return {};}\
      |                                                         ^
      |                                                         (            )
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:69:58: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
   69 |         virtual const std::vector<double> processToVectorDouble(INPUT_TYPEDEF &input) const {assert((INPUT_MODE) == inputMode && cnsModeVectorDouble == outputMode); return {};}\
      |                                                                 ^
      |                                                                 (            )
/data/data/com.termux/files/home/SubStack/cxx/ClassCns.hxx:70:44: warning: macro argument should be enclosed in parentheses [![Uploading Termux.png…]()]
   70 |         virtual const std::string processToString(INPUT_TYPEDEF &input) const {auto val = processToVectorChar(input); return std::string(&val[0], val.size());}
      |                                                   ^
      |                                                   (            )
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzs3N1u2zYUAOCnOb4hYkjU_4Uv5D-gQNsVa7JhVwMl0RJXmhRIKk329APlOHYTry1ay3ZSAsFxBJM60qH0RTEtEa1ZLSidQDSFaD4inWmkmiyuF7-_z99O394sio5z1YlRIav7CcTew483By-HGYbc20SEEwTJDJn7llZ0hUpOtEYzoREk0-fNn0fb--stfiwiiBaHNjftN7ftCs5KCPLv3sRNO7ysiCG7l1Kux4aqdXcHeLlinGrAy0auKeDlx674aEj5yTa7s-_PbG1mQo-buzsI8jCEIM8gyNFnogQTtf111YnSMCmuOPtE0ZqUSiLAiaHrlhND_5TqE1GyExXgBHWaVhBMUSmFZhVViNi2dsnQu1bZJtuOjytGEE3Lti2lonXHKsqZoPqqT3TVaVJTiOYH6haGfd0ABxVdMUHRoS1K37z_cHP997vf5gvAM7RZuv7rw2K-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