[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)
Piotr Zegar via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 1 07:32:11 PST 2025
================
@@ -0,0 +1,34 @@
+.. title:: clang-tidy - bugprone-incorrect-enable-shared-from-this
+
+bugprone-incorrect-enable-shared-from-this
+==========================================
+
+Detect classes or structs that do not publicly inherit from
+``std::enable_shared_from_this``, because unintended behavior will
+otherwise occur when calling ``shared_from_this``.
+
+Consider the following code:
----------------
PiotrZSL wrote:
Note: this line isn't needed
https://github.com/llvm/llvm-project/pull/102299
More information about the cfe-commits
mailing list