Kaydet (Commit) 965ac991 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

At least MSVC 19.15.26726 (VS 2017 15.8.1) needs the SAL_STREAM fix too

...that was originally introduced for libc++ in
691b6ea8 "Make the SAL_STREAM thing compile with
clang++ -std=c++11 -stdlib=libc++".  MSVC and clang-cl builds now started to
fail like

> [build CXX] sfx2/source/control/bindings.cxx
> C:/lo-clang/core/sfx2/source/control/bindings.cxx(1333,19):  error: dynamic_cast from rvalue to reference type '::std::ostringstream &' (aka 'basic_ostringstream<char, char_traits<char>, allocator<char> > &')
>                 ? SAL_STREAM("File: " << pFile << " Line: " << nLine) : ""));
>                 ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> C:/lo-clang/core/include\sal/log.hxx(169,6):  note: expanded from macro 'SAL_STREAM'
>     (dynamic_cast< ::std::ostringstream & >(::std::ostringstream() << stream).str())
>      ^
> C:/lo-clang/core/include\sal/log.hxx(306,20):  note: expanded from macro 'SAL_INFO'
>         SAL_WHERE, stream)
>         ~~~~~~~~~~~^~~~~~~
> C:/lo-clang/core/include\sal/log.hxx(120,53):  note: expanded from macro 'SAL_DETAIL_LOG_STREAM'
>                     ::sal::detail::StreamStart() << stream) == 1) \
>                                                     ^~~~~~
[...]

Change-Id: Icb311c8a61cd7e7f450a45fc7f07327e94b5d186
Reviewed-on: https://gerrit.libreoffice.org/59833
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 03b36167
......@@ -161,7 +161,7 @@ inline char const * unwrapStream(SAL_UNUSED_PARAMETER StreamIgnore const &) {
@since LibreOffice 3.5
*/
#ifdef _LIBCPP_VERSION
#if defined _LIBCPP_VERSION || (defined _MSC_VER && _MSC_VER >= 1915)
#define SAL_STREAM(stream) \
(::std::ostringstream() << stream).str()
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment