[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 20 12:23:53 PST 2024


https://github.com/PiotrZSL requested changes to this pull request.

I'm not fan of using "friends", currently they consider more a code-smell, and i'm not fan of exposing other private implementation to derived class, this could cause some issues, like give access to class that isn't a derived class (`Bad` example), even if object of such CRTP would never be created simply because static methods would be used.

I assume that this check base on this approach: https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/

Consider changing check name to more detailed, updating diagnostic, fixing known issues, adding more tests and proper support for all C++ standards, and then well, it could be merged.

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


More information about the cfe-commits mailing list