[clang-tools-extra] r217201 - Try to make VS 2012 happy after r217155

Hans Wennborg hans at hanshq.net
Thu Sep 4 15:41:03 PDT 2014


Author: hans
Date: Thu Sep  4 17:41:03 2014
New Revision: 217201

URL: http://llvm.org/viewvc/llvm-project?rev=217201&view=rev
Log:
Try to make VS 2012 happy after r217155

It was failing with:

C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\llvm\include\llvm/Support/ErrorOr.h(102) : error C3861: 'make_error_code': identifier not found

        C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\clang-tools-extra\clang-tidy\ClangTidyOptions.cpp(153) : see reference to function template instantiation 'llvm::ErrorOr<T>::ErrorOr<std::errc::errc>(E,void *)' being compiled

        with
        [
            T=clang::tidy::ClangTidyOptions,
            E=std::errc::errc
        ]

Modified:
    clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp

Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp?rev=217201&r1=217200&r2=217201&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp Thu Sep  4 17:41:03 2014
@@ -10,6 +10,7 @@
 #include "ClangTidyOptions.h"
 #include "clang/Basic/LLVM.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Support/Errc.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
@@ -137,7 +138,7 @@ const ClangTidyOptions &FileOptionsProvi
       }
       return CachedOptions.GetOrCreateValue(Path, *Result).getValue();
     }
-    if (Result.getError() != std::errc::no_such_file_or_directory) {
+    if (Result.getError() != llvm::errc::no_such_file_or_directory) {
       llvm::errs() << "Error reading " << ConfigFileName << " from " << Path
                    << ": " << Result.getError().message() << "\n";
     }
@@ -150,7 +151,7 @@ FileOptionsProvider::TryReadConfigFile(S
 
   ClangTidyOptions Options = DefaultOptionsProvider::getOptions(Directory);
   if (!llvm::sys::fs::is_directory(Directory))
-    return std::errc::not_a_directory;
+    return make_error_code(llvm::errc::not_a_directory);
 
   SmallString<128> ConfigFile(Directory);
   llvm::sys::path::append(ConfigFile, ".clang-tidy");
@@ -162,7 +163,7 @@ FileOptionsProvider::TryReadConfigFile(S
   llvm::sys::fs::is_regular_file(Twine(ConfigFile), IsFile);
 
   if (!IsFile)
-    return std::errc::no_such_file_or_directory;
+    return make_error_code(llvm::errc::no_such_file_or_directory);
 
   llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> Text =
       llvm::MemoryBuffer::getFile(ConfigFile.c_str());





More information about the cfe-commits mailing list