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

via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 22 06:49:01 PST 2024


================
@@ -0,0 +1,62 @@
+.. title:: clang-tidy - bugprone-unsafe-crtp
+
+bugprone-unsafe-crtp
+====================
+
+Finds CRTP used in an error-prone way.
+
+If the constructor of a class intended to be used in a CRTP is public, then
+it allows users to construct that class on its own.
----------------
whisperity wrote:

Just by reading the documentation, this single sentence seems incomplete. It does not look like it could convince someone without intricate C++ knowledge about why allowing such thing is bad. No need for something elaborate here, but perhaps another sentence that summarises the _"Why?"_ should fit here.

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


More information about the cfe-commits mailing list