From ecdd589ea6470e8496014686d9b74dc5a7a342a1 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 21 Sep 2016 22:29:36 +0000 Subject: [PATCH] =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 --- include/llvm/ADT/StringRef.h | 2 ++ 1 file changed, 2 insertions(+) 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) { -- 2.11.0