On Tue, Apr 05, 2016 at 05:27:45PM +0000, Ben Craig via cfe-commits wrote:
> bcraig added a subscriber: bcraig.
> bcraig added a comment.
> 
> 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.

In that case, it would be nice if it also handles the correct pattern
of:

const char bad_chars[] = "\0\1\2\3";
std::string bad_str(bad_chars, sizeof bad_chars);

Joerg
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to