[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

Nicolas van Kempen via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 12 09:13:38 PDT 2024


================
@@ -19,20 +19,35 @@ Example:
 .. code-block:: c++
 
   struct Base {
-    virtual void ~Base();
+    virtual ~Base();
+    int i;
   };
-
+  
   struct Derived : public Base {};
-
-  void foo() {
-    Base *b = new Derived[10];
-
+  
+  // Function that takes a pointer and performs pointer arithmetic
----------------
nicovank wrote:

```suggestion
```

IMO this is redundant.

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


More information about the cfe-commits mailing list