[PATCH] D12186: Fix bug in modernize-loop-convert check.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 20 03:26:36 PDT 2015


bkramer added a comment.

In http://reviews.llvm.org/D12186#228702, @angelgarcia wrote:

> It is allowed as long as you specify that the length is 0.


I meant the code before your change, which calls `StringRef(const char *Str)` and completely disallows nullptr. In other words: this change is missing a regression test.

> I thought that this way it was clear that I was returning an empty

>  string, but they are both equivalent. I can change it if you think the

>  default constructor is better.


I prefer the default ctor. Using nullptr for the empty string is just an implementation detail, exposing it doesn't add clarity in my opinion.


http://reviews.llvm.org/D12186





More information about the cfe-commits mailing list