This revision was automatically updated to reflect the committed changes. Closed by commit rC340929: [Preamble] Fix incorrect usage of std::error_category (authored by aganea, committed by ).
Repository: rC Clang https://reviews.llvm.org/D51380 Files: lib/Frontend/PrecompiledPreamble.cpp Index: lib/Frontend/PrecompiledPreamble.cpp =================================================================== --- lib/Frontend/PrecompiledPreamble.cpp +++ lib/Frontend/PrecompiledPreamble.cpp @@ -742,8 +742,10 @@ 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 {
Index: lib/Frontend/PrecompiledPreamble.cpp =================================================================== --- lib/Frontend/PrecompiledPreamble.cpp +++ lib/Frontend/PrecompiledPreamble.cpp @@ -742,8 +742,10 @@ 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 {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits