[PATCH] D40829: [clang-tidy] adjust cppcoreguidelines-owning-memory documentation

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 02:40:48 PST 2017


JonasToth created this revision.
Herald added subscribers: cfe-commits, kbarton, xazax.hun, nemanjai, klimek.

A user of the check opened a bugreport and reported that `std::exchange`
triggers a false positive. I adjusted the doc to include a list of known
(std) constructs that do trigger the issue with templates forgetting the
type alias.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D40829

Files:
  docs/clang-tidy/checks/cppcoreguidelines-owning-memory.rst


Index: docs/clang-tidy/checks/cppcoreguidelines-owning-memory.rst
===================================================================
--- docs/clang-tidy/checks/cppcoreguidelines-owning-memory.rst
+++ docs/clang-tidy/checks/cppcoreguidelines-owning-memory.rst
@@ -111,7 +111,11 @@
 In template functions and classes, like in the example below, the information
 of the type aliases gets lost. Therefore using ``gsl::owner<T*>`` in a heavy templated
 code base might lead to false positives. 
-This limitation results in ``std::vector<gsl::owner<T*>>`` not being diagnosed correctly.
+
+Known code constructs that do not get diagnosed correctly are
+
+- ``std::exchange``
+- ``std::vector<gsl::owner<T*>>``
 
 .. code-block:: c++
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40829.125486.patch
Type: text/x-patch
Size: 730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171205/d836f155/attachment.bin>


More information about the cfe-commits mailing list