[Libreoffice-commits] core.git: config_host/config_global.h.in configure.ac include/sal
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Dec 7 21:47:42 UTC 2018
config_host/config_global.h.in | 3 ---
configure.ac | 9 ++++-----
include/sal/types.h | 8 --------
3 files changed, 4 insertions(+), 16 deletions(-)
New commits:
commit 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Dec 7 11:57:21 2018 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Dec 7 22:47:08 2018 +0100
HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now
...but for safety, leave the configure.ac check in for some longer.
Also, save removing now-redundant SAL_FALLTHROUGH for a follow-up commit.
Change-Id: I9bf42d237aea4c09459f28275568cf340e588607
Reviewed-on: https://gerrit.libreoffice.org/64770
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/config_host/config_global.h.in b/config_host/config_global.h.in
index 605a7fe0ed9d..a84f2bedec5a 100644
--- a/config_host/config_global.h.in
+++ b/config_host/config_global.h.in
@@ -21,9 +21,6 @@ Any change in this header will cause a rebuild of almost everything.
/* Compiler supports __attribute__((warn_unused)). */
#define HAVE_GCC_ATTRIBUTE_WARN_UNUSED 0
-/* [[fallthrough]] (C++17), __has_cpp_attribute(fallthrough) (C++2a): */
-#define HAVE_CPP_ATTRIBUTE_FALLTHROUGH 0
-
/* [[nodiscard]] (C++17), __has_cpp_attribute(nodiscard) (C++2a): */
#define HAVE_CPP_ATTRIBUTE_NODISCARD 0
diff --git a/configure.ac b/configure.ac
index 3d25986d1fae..0055641ae95f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6413,7 +6413,8 @@ if test "$GCC" = yes; then
fi
AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
-AC_MSG_CHECKING([[whether $CXX supports [[fallthrough]]]])
+dnl This check can eventually be removed completely (e.g., after libreoffice-6-3 branch off):
+AC_MSG_CHECKING([[that $CXX supports [[fallthrough]]]])
AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
@@ -6441,10 +6442,8 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
}
}
#endif
- ]])], [
- AC_DEFINE([HAVE_CPP_ATTRIBUTE_FALLTHROUGH],[1])
- AC_MSG_RESULT([yes])
- ], [AC_MSG_RESULT([no])])
+ ]])],
+ AC_MSG_RESULT([yes]), AC_MSG_ERROR([$CXX lacks required [[fallthrough]] support]))
CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++])
diff --git a/include/sal/types.h b/include/sal/types.h
index b687490ed949..6e20a854861f 100644
--- a/include/sal/types.h
+++ b/include/sal/types.h
@@ -410,15 +410,7 @@ namespace css = ::com::sun::star;
#endif
#if defined LIBO_INTERNAL_ONLY
-#if HAVE_CPP_ATTRIBUTE_FALLTHROUGH
#define SAL_FALLTHROUGH [[fallthrough]]
-#elif defined __clang__
- /* before Clang 3.9, according to
- <https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B17_features> */
-#define SAL_FALLTHROUGH [[clang::fallthrough]]
-#else
-#define SAL_FALLTHROUGH
-#endif
#endif
#endif /* __cplusplus */
More information about the Libreoffice-commits
mailing list