Issue |
95955
|
Summary |
[Clang Tidy] `bugprone-macro-parentheses` should not trigger for function prototypes (which C++ does not allow to nest parenthesis)
|
Labels |
clang
|
Assignees |
|
Reporter |
ETERNALBLUEbullrun
|
```
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());}
| ^
| ( )
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs