summaryrefslogtreecommitdiff
path: root/lldb/source/Utility/RegularExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Utility/RegularExpression.cpp')
-rw-r--r--lldb/source/Utility/RegularExpression.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Utility/RegularExpression.cpp b/lldb/source/Utility/RegularExpression.cpp
index fd9d963f7294c..20bebbfe15f27 100644
--- a/lldb/source/Utility/RegularExpression.cpp
+++ b/lldb/source/Utility/RegularExpression.cpp
@@ -1,4 +1,4 @@
-//===-- RegularExpression.cpp -----------------------------------*- C++ -*-===//
+//===-- RegularExpression.cpp ---------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -13,7 +13,7 @@
using namespace lldb_private;
RegularExpression::RegularExpression(llvm::StringRef str)
- : m_regex_text(str),
+ : m_regex_text(std::string(str)),
// m_regex does not reference str anymore after it is constructed.
m_regex(llvm::Regex(str)) {}
@@ -35,7 +35,7 @@ llvm::StringRef RegularExpression::GetText() const { return m_regex_text; }
llvm::Error RegularExpression::GetError() const {
std::string error;
if (!m_regex.isValid(error))
- return llvm::make_error<llvm::StringError>(llvm::inconvertibleErrorCode(),
- error);
+ return llvm::make_error<llvm::StringError>(error,
+ llvm::inconvertibleErrorCode());
return llvm::Error::success();
}