[Libreoffice-commits] core.git: compilerplugins/clang

Stephan Bergmann sbergman at redhat.com
Thu Aug 28 02:34:16 PDT 2014


 compilerplugins/clang/compat.hxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 05ead076b4a58cd18eee35ea97f9577333f6af38
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Aug 28 11:33:32 2014 +0200

    Adapt compilerplugins to Clang trunk towards 3.6
    
    Change-Id: Id1ce6c59f705f9c42855995e0ad590c6a3646613

diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index 5533e8f..e6ce98e 100644
--- a/compilerplugins/clang/compat.hxx
+++ b/compilerplugins/clang/compat.hxx
@@ -151,7 +151,13 @@ inline unsigned getCustomDiagID(
 inline std::unique_ptr<llvm::raw_fd_ostream> create_raw_fd_ostream(
     char const * Filename, std::string & ErrorInfo)
 {
-#if (__clang_major__ == 3 && __clang_minor__ >= 5) || __clang_major__ > 3
+#if (__clang_major__ == 3 && __clang_minor__ >= 6) || __clang_major__ > 3
+    std::error_code ec;
+    std::unique_ptr<llvm::raw_fd_ostream> s(
+        new llvm::raw_fd_ostream(Filename, ec, llvm::sys::fs::F_None));
+    ErrorInfo = ec ? "error: " + ec.message() : std::string();
+    return s;
+#elif __clang_major__ == 3 && __clang_minor__ == 5
     return std::unique_ptr<llvm::raw_fd_ostream>(
         new llvm::raw_fd_ostream(Filename, ErrorInfo, llvm::sys::fs::F_None));
 #else


More information about the Libreoffice-commits mailing list