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

Angel Garcia via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 20 03:14:37 PDT 2015


angelgarcia added a comment.

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

assert https://cs.corp.google.com/#piper///depot/google3/third_party/grte/v4_x86/release/usr/grte/v4/include/assert.h&l=85&ct=xref_jump_to_def&cl=GROK&gsn=assert((data
https://cs.corp.google.com/#piper///depot/google3/third_party/llvm/llvm/include/llvm/ADT/StringRef.h&l=76&ct=xref_jump_to_def&cl=GROK&gsn=data

|  | length https://cs.corp.google.com/#piper///depot/google3/third_party/llvm/llvm/include/llvm/ADT/StringRef.h&l=76&ct=xref_jump_to_def&cl=GROK&gsn=length |

0) &&        "StringRef cannot be built from a NULL argument with
-----------------------------------------------------------------

non-null length");

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.


http://reviews.llvm.org/D12186





More information about the cfe-commits mailing list