]> granicus.if.org Git - clang/commitdiff
[Preamble] Fix incorrect usage of std::error_category
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>
Wed, 29 Aug 2018 14:28:04 +0000 (14:28 +0000)
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>
Wed, 29 Aug 2018 14:28:04 +0000 (14:28 +0000)
Differential Revision: https://reviews.llvm.org/D51380

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340929 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/PrecompiledPreamble.cpp

index 239e0dd974aa9b5cd61f211f6a19804c710ccb1d..c6dd89c05cbb03e5a1c21046cdf25ee7665691d3 100644 (file)
@@ -742,8 +742,10 @@ std::unique_ptr<PPCallbacks> PreambleCallbacks::createPPCallbacks() {
   return nullptr;
 }
 
+static llvm::ManagedStatic<BuildPreambleErrorCategory> BuildPreambleErrCategory;
+
 std::error_code clang::make_error_code(BuildPreambleError Error) {
-  return std::error_code(static_cast<int>(Error), BuildPreambleErrorCategory());
+  return std::error_code(static_cast<int>(Error), *BuildPreambleErrCategory);
 }
 
 const char *BuildPreambleErrorCategory::name() const noexcept {