diff --git a/clang/lib/Analysis/CloneDetection.cpp b/clang/lib/Analysis/CloneDetection.cpp --- a/clang/lib/Analysis/CloneDetection.cpp +++ b/clang/lib/Analysis/CloneDetection.cpp @@ -153,9 +153,8 @@ bool FilenamePatternConstraint::isAutoGenerated( const CloneDetector::CloneGroup &Group) { - std::string Error; if (IgnoredFilesPattern.empty() || Group.empty() || - !IgnoredFilesRegex->isValid(Error)) + !IgnoredFilesRegex->isValid()) return false; for (const StmtSequence &S : Group) { diff --git a/lldb/source/Utility/RegularExpression.cpp b/lldb/source/Utility/RegularExpression.cpp --- a/lldb/source/Utility/RegularExpression.cpp +++ b/lldb/source/Utility/RegularExpression.cpp @@ -28,10 +28,7 @@ return m_regex.match(str, matches); } -bool RegularExpression::IsValid() const { - std::string discarded; - return m_regex.isValid(discarded); -} +bool RegularExpression::IsValid() const { return m_regex.isValid(); } llvm::StringRef RegularExpression::GetText() const { return m_regex_text; } diff --git a/llvm/include/llvm/Support/Regex.h b/llvm/include/llvm/Support/Regex.h --- a/llvm/include/llvm/Support/Regex.h +++ b/llvm/include/llvm/Support/Regex.h @@ -57,6 +57,7 @@ /// isValid - returns the error encountered during regex compilation, or /// matching, if any. bool isValid(std::string &Error) const; + bool isValid() const { return !error; } /// getNumMatches - In a valid regex, return the number of parenthesized /// matches it contains. The number filled in by match will include this