[clang-tools-extra] [clang-tidy] Create bugprone-public-enable-shared-from-this check (PR #102299)

via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 7 04:50:22 PDT 2024


================
@@ -98,6 +98,11 @@ Improvements to clang-tidy
 New checks
 ^^^^^^^^^^
 
+- New :doc:`bugprone-public-enable-shared-from-this
+  <clang-tidy/checks/bugprone/public-enable-shared-from-this>` check.
+
+  Checks if a class deriving from enable_shared_from_this has public access specifiers, because otherwise the program will crash when shared_from_this is called.
----------------
MichelleCDjunaidi wrote:

Right, will run git clang format, thanks for the reminder and feedback

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


More information about the cfe-commits mailing list