[PATCH] D123655: [clang-tidy] Add portability-std-allocator-const-t check

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 13 07:33:00 PDT 2022


Eugene.Zelenko added a comment.

Shouldn't this check be enabled only when libstdc++ is used?



================
Comment at: clang-tools-extra/docs/clang-tidy/checks/portability-std-allocator-const-t.rst:6
+
+Per C++ ``[allocator.requirements.general]``: "T is any cv-unqualified object
+type", ``std::allocator<const T>`` is undefined. Many standard containers use
----------------
sammccall wrote:
> this seems a bit standard-ese for the intro paragraph.
> 
> Maybe add a paragraph before it: "This check reports use of `vector<const T>` (and similar containers of const elements). These are not allowed in standard C++, and should usually be `vector<T>` instead."
Please synchronize first sentence with Release Notes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123655/new/

https://reviews.llvm.org/D123655



More information about the cfe-commits mailing list