]> granicus.if.org Git - llvm/commit
Re-add the assert to StringRef's const char *, length constructor.
authorZachary Turner <zturner@google.com>
Tue, 20 Dec 2016 17:57:56 +0000 (17:57 +0000)
committerZachary Turner <zturner@google.com>
Tue, 20 Dec 2016 17:57:56 +0000 (17:57 +0000)
commitdba614135bfc5e59d3ddd51a0796e975dfadf18d
tree5fbe06848e34ab2f4c8fd1dc2f67c9a6a631afa9
parentb0d6793fd5ea906170e532bb31fbe14b5ca0ad9c
Re-add the assert to StringRef's const char *, length constructor.

By putting the assert behind a conditional in the initializer list
we can ensure that it will still work in a constexpr context as
the else branch of the ternary operator won't be examined unless
the condition fails.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290188 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/StringRef.h