Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit ecdd589

Browse files
author
Zachary Turner
committed
=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
1 parent a6b3c30 commit ecdd589

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/llvm/ADT/StringRef.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ namespace llvm {
6868
/// Construct an empty string ref.
6969
/*implicit*/ StringRef() : Data(nullptr), Length(0) {}
7070

71+
StringRef(std::nullptr_t) = delete;
72+
7173
/// Construct a string ref from a cstring.
7274
/*implicit*/ StringRef(const char *Str)
7375
: Data(Str) {

0 commit comments

Comments
 (0)