summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-01-20 11:29:18 +0100
committerStephan Bergmann <sbergman@redhat.com>2021-01-21 07:58:02 +0100
commitaf34108d90bbbce90cf00c4b23961787599c7fa5 (patch)
treede3130c4d4fd8e5f163d084f87f750188297235b /configure.ac
parente64784c4e8775d0c831ad71c70e73854a4b9aaa4 (diff)
Use C++20 consteval for the Color(sal_uInt32) ctor
...to make it more obvious that, since 63a68064bb33f180b8a231f7524d99405d910226 "make the Color constructors explicitly specify transparency", it should only be called when the argument is known at compile-time to have no transparency/alpha channel. (This revealed a GCC bug causing bogus > xmloff/source/chart/ColorPropertySet.cxx: In constructor ‘xmloff::chart::ColorPropertySet::ColorPropertySet(Color)’: > xmloff/source/chart/ColorPropertySet.cxx:81:9: error: ‘this’ is not a constant expression > 81 | m_nDefaultColor( 0x0099ccff ) // blue 8 > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ so in configure.ac suppress HAVE_CPP_CONSTEVAL when the compiler is found broken.) Change-Id: I68df7bd5fbd9b2dcf2243b5a4bde4064d3d665fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109697 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 9 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 458a4857b378..f60c1ae5a199 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7189,7 +7189,9 @@ AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
AC_MSG_CHECKING([whether $CXX_BASE supports a working C++20 consteval])
dnl ...that does not suffer from <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994> "Missing code
-dnl from consteval constructor initializing const variable":
+dnl from consteval constructor initializing const variable" or
+dnl <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98752> "wrong 'error: ‘this’ is not a constant
+dnl expression' with consteval constructor":
AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
@@ -7199,6 +7201,12 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([
int i = 0;
};
S const s;
+
+ struct S1 { consteval S1(int) {} };
+ struct S2 {
+ S1 x;
+ S2(): x(0) {}
+ };
], [
return (s.i == 1) ? 0 : 1;
])], [