[PATCH] D49228: [analyzer][UninitializedObjectChecker] Void pointer objects are casted back to their dynmic type in note message

Whisperity via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 26 02:27:17 PDT 2018


whisperity added inline comments.


================
Comment at: test/Analysis/cxx-uninitialized-object-ptr-ref.cpp:290
 struct IntDynTypedVoidPointerTest1 {
-  void *vptr; // expected-note{{uninitialized pointee 'this->vptr'}}
+  void *vptr; // expected-note{{uninitialized pointee 'this->static_cast<int *>(vptr)'}}
   int dontGetFilteredByNonPedanticMode = 0;
----------------
NoQ wrote:
> Shouldn't this rather say something like `static_cast<int *>(this->vptr)`? That's the normal syntax to do this sort of stuff, i guess.
Not just "normal syntax", this syntax of the output does not compile.

```
foo.cpp:6:13: error: expected unqualified-id
      this->static_cast<int*>(vptr) = new int();
```


https://reviews.llvm.org/D49228





More information about the cfe-commits mailing list