Index: include/llvm/ADT/StringRef.h =================================================================== --- include/llvm/ADT/StringRef.h +++ include/llvm/ADT/StringRef.h @@ -73,14 +73,9 @@ /// Construct an empty string ref. /*implicit*/ StringRef() : Data(nullptr), Length(0) {} - StringRef(std::nullptr_t) = delete; - /// Construct a string ref from a cstring. /*implicit*/ StringRef(const char *Str) - : Data(Str) { - assert(Str && "StringRef cannot be built from a NULL argument"); - Length = ::strlen(Str); // invoking strlen(NULL) is undefined behavior - } + : Data(Str), Length(Str ? ::strlen(Str) : 0) {} /// Construct a string ref from a pointer and length. LLVM_ATTRIBUTE_ALWAYS_INLINE