[llvm] r290189 - Revert "Re-add the assert to StringRef's const char *, length constructor."

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 10:05:48 PST 2016


Author: zturner
Date: Tue Dec 20 12:05:47 2016
New Revision: 290189

URL: http://llvm.org/viewvc/llvm-project?rev=290189&view=rev
Log:
Revert "Re-add the assert to StringRef's const char *, length constructor."

This reverts commit r290188, which is causing internal compiler errors
on GCC 4.8

Modified:
    llvm/trunk/include/llvm/ADT/StringRef.h

Modified: llvm/trunk/include/llvm/ADT/StringRef.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringRef.h?rev=290189&r1=290188&r2=290189&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringRef.h (original)
+++ llvm/trunk/include/llvm/ADT/StringRef.h Tue Dec 20 12:05:47 2016
@@ -85,9 +85,7 @@ namespace llvm {
     /// Construct a string ref from a pointer and length.
     LLVM_ATTRIBUTE_ALWAYS_INLINE
     /*implicit*/ constexpr StringRef(const char *data, size_t length)
-        : Data(data),
-          Length((data || length == 0) ? length : (assert(0 && "Bad StringRef"),
-                                                   length)) {}
+        : Data(data), Length(length) {}
 
     /// Construct a string ref from an std::string.
     LLVM_ATTRIBUTE_ALWAYS_INLINE




More information about the llvm-commits mailing list