[clang-tools-extra] [clang-tidy] add 'IgnoreMarcos' option to 'special-member-functions' check (PR #143550)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 21 10:50:59 PDT 2025


vbvictor wrote:

> Actually, the cxxRecordDecl might not be in a macro, but the special member functions are.

The checker doc states:
`The check finds classes where some but not all of the special member functions are defined.`
I think we only need to ignore if the whole class expands from macro. If not, I don't see a reason why a user can't provided needed members.

> I'd prefer to see a warning for expansions of macros defined inside the code base

I think we could just limit the scope of the whole check by `unless(isExpansionInSystemHeader())`.
There was some work by [carlosgalvezp](https://github.com/carlosgalvezp) to ignore system headers in all checks by default so maybe this addition will become obsolete soon.

> I'm +- on the default

FYI there are total of 22 checks that use `IgnoreMacros` option, 17 of them have `true` by default and 5 have `false`


https://github.com/llvm/llvm-project/pull/143550


More information about the cfe-commits mailing list