[PATCH] D143851: [clang-tidy] Tweak 'rule of 3/5' checks to allow defaulting a destructor outside the class.

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 14 10:02:33 PST 2023


carlosgalvezp added a comment.

> This is why this option was only available for destructors in the first place, I imagine.

The `cppcoreguidelines` are a bit tricky to work with. Some of the rules are too strict to reasonably apply them in practice. We have brought this up with the authors of the guidelines but they have rejected proposals for modification. That's why in clang-tidy we aim at having by default the strict behavior so the check follows the rules "as-is", while also adding options that allow users to slightly deviate from the rules, to be more pragmatic. Thus if we want some new behavior that deviates from the rule text as it's written we should preferably implement it as an option.

> About the second point - this sounds pretty general, doesn't clang-tidy already filter diagnostics in system headers? At least Clang does.

Yes, clang-tidy will not issue warnings in system headers, so checks should not need to explicitly handle that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143851/new/

https://reviews.llvm.org/D143851



More information about the cfe-commits mailing list