I have a macro which instantiates a global variable. And thus clang-tidy will correctly issue an "Initialization of ... with static storage duration may throw an exception which cannot be caught".
Can I disable this warning on a per-macro basis? Preferable inline where the macro is defined.
That is, let's say I have:
// header.h
#define UGLY_MACRO(X) SomeClass X(#X)
// source.cpp
UGLY_MACRO(SomeName); // clang-tidy complains here
And I want clang-tidy to stop complaining about this.
I want to be as specific as possible. I only want to turn of this warning for this macro. I do not want to turn of the warning globally, then someone might add more of this kind of macros into the code unnoticed. Also, I don’t want to add something (like a //NOLNT(...)) at every place where the macro is used, that would be too much of a hassle.
Or am I approaching this from the wrong direction? I have worked with pc-lint before, where this is possible.