[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 12 08:53:26 PDT 2017


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM, with a few last typos.



================
Comment at: test/clang-tidy/cppcoreguidelines-owning-memory.cpp:354
+
+// FIXME: Same typededcution problems
+template <typename T>
----------------
typededuction -> type deduction

(here and elsewhere)


================
Comment at: test/clang-tidy/cppcoreguidelines-owning-memory.cpp:372
+  Owner1.setVal(stack_ptr1);                            // Bad since non-owner assignment
+  //Owner1.setVal(new int(42)); // Ok, but since typededuction is wrong, this one is considered harmfull
+
----------------
harmfull -> harmful


================
Comment at: test/clang-tidy/cppcoreguidelines-owning-memory.cpp:374
+
+  int *stack_ptr2 = Owner1.getVal(); // Bad, initializing nonowner with owner
+
----------------
nonowner -> non-owner

(here and elsewhere)


https://reviews.llvm.org/D36354





More information about the cfe-commits mailing list