From: Zachary Turner Date: Wed, 21 Sep 2016 22:29:36 +0000 (+0000) Subject: =delete the StringRef(nullptr_t) constructor. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ecdd589ea6470e8496014686d9b74dc5a7a342a1;p=llvm =delete the StringRef(nullptr_t) constructor. It's a guaranteed crash if you construct a StringRef with nullptr, so might as well delete the constructor that allows it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282116 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h index 5d0aafc4683..ff423e8a340 100644 --- a/include/llvm/ADT/StringRef.h +++ b/include/llvm/ADT/StringRef.h @@ -68,6 +68,8 @@ namespace llvm { /// 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) {