[PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

Etienne Bergeron via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 5 10:49:43 PDT 2016


etienneb added a comment.

In http://reviews.llvm.org/D18783#392486, @bcraig wrote:

> Is this checker able to connect a std::string with a pre-declared string literal (i.e. constant propagation)?  For example...
>
>   const char *bad_chars = "\0\1\2\3";
>   std::string bad_str = bad_chars;
>  
>
>
> I've had real code make that mistake before.


Not yet, but I already started working in it.
There is more false-positive to remove first. It will follow this patch soon.


http://reviews.llvm.org/D18783





More information about the cfe-commits mailing list