llvm-project/clang-tools-extra/docs
CJ Johnson 6a9487df73 Add new clang-tidy check for string_view(nullptr)
Checks for various ways that the `const CharT*` constructor of `std::basic_string_view` can be passed a null argument and replaces them with the default constructor in most cases. For the comparison operators, braced initializer list does not compile so instead a call to `.empty()` or the empty string literal are used, where appropriate.

This prevents code from invoking behavior which is unconditionally undefined. The single-argument `const CharT*` constructor does not check for the null case before dereferencing its input. The standard is slated to add an explicitly-deleted overload to catch some of these cases: wg21.link/p2166

https://reviews.llvm.org/D114823 is a companion change to prevent duplicate warnings from the `bugprone-string-constructor` check.

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D113148
2021-12-02 13:25:28 +00:00
..
_static Added more detailed documentation for clangd 2019-02-27 15:53:05 +00:00
_templates [clangd] Redirect documentation to clangd.llvm.org. 2020-03-12 11:45:40 +01:00
clang-tidy Add new clang-tidy check for string_view(nullptr) 2021-12-02 13:25:28 +00:00
clangd [clangd] Add README pointing to docs, bugtracker etc. NFC 2020-03-12 14:00:08 +01:00
CMakeLists.txt
ModularizeUsage.rst
README.txt Updated the documentation build instructions for the current CMake build system 2019-02-25 13:03:44 +00:00
ReleaseNotes.rst Add new clang-tidy check for string_view(nullptr) 2021-12-02 13:25:28 +00:00
clang-doc.rst doc: Document that extra-arg/extra-arg-before can be used several times 2019-12-24 13:07:08 +01:00
clang-include-fixer.rst [docs] Update path to clang-tools-extra 2020-01-02 19:30:29 +08:00
clang-modernize.rst
clang-rename.rst [Branch-Rename] Fix some links 2021-02-01 16:43:21 +05:30
clang-tidy.rst
clangd.rst [clangd] Redirect documentation to clangd.llvm.org. 2020-03-12 11:45:40 +01:00
conf.py Bump the trunk major version to 14 2021-07-27 21:58:25 -07:00
cpp11-migrate.rst
doxygen-mainpage.dox
doxygen.cfg.in [NFC] Inclusive Language: change master to main for .chm files 2021-11-08 08:23:04 -06:00
index.rst [clangd] Redirect documentation to clangd.llvm.org. 2020-03-12 11:45:40 +01:00
make.bat
modularize.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
pp-trace.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00

README.txt

----------------------------------
Documentation in clang-tools-extra
----------------------------------

To generate documentation in HTML format from files in clang-tools-extra/docs,
build the docs-clang-tools-html target.

To generate documentation from the source code using Doxygen, build the
doxygen-clang-tools target.