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

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 23 10:16:03 PDT 2025


5chmidti 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.

Good point 

> > 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.

Yeah, this was just a thought. But that work would not be for this (I think). I meant macros defined in system headers, but with expansions in user code.

> > I'm +- on the default
> 
> FYI there is a total of 22 checks that use `IgnoreMacros` option, 17 of them have `true` by default and 5 have `false`
> 

Then let's stay with what it is now (true). For things like goto, it makes IMO sense to use false because goto is a really bad pattern.


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


More information about the cfe-commits mailing list