summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/misc-string-literal-with-embedded-nul.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] add new checker for string literal with NUL character.Etienne Bergeron2016-04-071-0/+85
Summary: This patch adds the support for detecting suspicious string literals and their //incorrect// usage. The following example shows a incorrect character escaping leading to an embedded NUL character. ``` std::string str = "\0x42"; // Should be "\x42". ``` The patch also add detection of truncated literal when a literal is passed to a string constructor. Reviewers: hokein, alexfh Subscribers: LegalizeAdulthood, bcraig, Eugene.Zelenko, bkramer, cfe-commits Differential Revision: http://reviews.llvm.org/D18783 llvm-svn: 265691
OpenPOWER on IntegriCloud