diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-12-15 11:05:00 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-12-15 22:23:31 +0100 |
commit | c5f6043b0f2c4cb521e8694dbf3dd355042fd704 (patch) | |
tree | 328fad1064ebe23c4feb485f0ec7ed05ecceb809 /configure.ac | |
parent | be46bc5d20ad82be1d9c8513a83584ecee9edbc2 (diff) |
Enable C++17 for clang-cl, too
Similar to libc++ in C++17 mode, some types like std::auto_ptr are indeed
removed in C++17 mode by default, and need _HAS_AUTO_PTR_ETC=1 to be enabled
(see <https://blogs.msdn.microsoft.com/vcblog/2017/12/08/c17-feature-removals-
and-deprecations/>).
Unlike libc++, also std::binary_function and std::unary_function are removed
(and need the same _HAS_AUTO_PTR_ETC=1 to enable). So either set that flag to
make external code build, or use patches (for external/mdds) to make externals'
files included in LO proper still work there.
Change-Id: I886cc0de8196255334ee03ec48cb4bc54d460afd
Reviewed-on: https://gerrit.libreoffice.org/46514
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 6645af1aab51..bd5f184f66ae 100644 --- a/configure.ac +++ b/configure.ac @@ -6037,11 +6037,11 @@ libo_FUZZ_ARG_ENABLE(c++17, ) CXXFLAGS_CXX11= -if test "$COM" = MSC; then +if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then AC_MSG_CHECKING([whether $CXX supports C++11]) AC_MSG_RESULT(yes) # MSVC supports (a subset of) CXX11 without any switch -elif test "$GCC" = "yes"; then +elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then HAVE_CXX11= AC_MSG_CHECKING([whether $CXX supports C++17, C++14, or C++11]) dnl But only use C++17 if the gperf that is being used knows not to emit @@ -6052,6 +6052,9 @@ elif test "$GCC" = "yes"; then my_flags="-std=gnu++17 -std=gnu++1z -std=c++17 -std=c++1z $my_flags" fi for flag in $my_flags; do + if test "$COM" = MSC; then + flag="-Xclang $flag" + fi save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS $flag -Werror" if test "$SYSTEM_LIBCMIS" = TRUE; then |