llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tidy

Author: richardmilles

<details>
<summary>Changes</summary>

## Summary
- The documentation for `cppcoreguidelines-virtual-class-destructor` claimed 
the check implements C.35 in full.
- It only enforces the first C.35 rule (classes with virtual functions must 
have a public virtual or protected non-virtual destructor).
- Clarify that the second C.35 rule (base classes of publicly derived classes) 
is not currently enforced.

Fixes #<!-- -->186628

## Test plan
- [ ] Docs-only change; no functional tests required
- [ ] Review rendered wording against C.35 enforcement rules

Assisted-by: Cursor

Made with [Cursor](https://cursor.com)

---
Full diff: https://github.com/llvm/llvm-project/pull/214659.diff


1 Files Affected:

- (modified) 
clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/virtual-class-destructor.rst
 (+7-3) 


``````````diff
diff --git 
a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/virtual-class-destructor.rst
 
b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/virtual-class-destructor.rst
index 80932c416fe01..4781a3c6e937a 100644
--- 
a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/virtual-class-destructor.rst
+++ 
b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/virtual-class-destructor.rst
@@ -7,9 +7,13 @@ Finds virtual classes whose destructor is neither public and 
virtual
 nor protected and non-virtual. A virtual class's destructor should be specified
 in one of these ways to prevent undefined behavior.
 
-This check implements
+This check implements the first enforcement rule of
 `C.35 
<http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#rc-dtor-virtual>`_
-from the C++ Core Guidelines.
+from the C++ Core Guidelines: a class with any virtual functions should have a
+destructor that is either public and virtual or else protected and non-virtual.
+
+It does not currently enforce the second rule of C.35, which requires that a
+base class of a publicly derived class also have such a destructor.
 
 Note that this check will diagnose a class with a virtual method regardless of
 whether the class is used as a base class or not.
@@ -24,7 +28,7 @@ Example
 -------
 
 For example, the following classes/structs get flagged by the check since they
-violate guideline **C.35**:
+violate the first enforcement rule of **C.35**:
 
 .. code-block:: c++
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/214659
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to