diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-01-20 11:29:18 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-01-21 07:58:02 +0100 |
commit | af34108d90bbbce90cf00c4b23961787599c7fa5 (patch) | |
tree | de3130c4d4fd8e5f163d084f87f750188297235b /compilerplugins/clang/test | |
parent | e64784c4e8775d0c831ad71c70e73854a4b9aaa4 (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 'compilerplugins/clang/test')
-rw-r--r-- | compilerplugins/clang/test/doubleconvert.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compilerplugins/clang/test/doubleconvert.cxx b/compilerplugins/clang/test/doubleconvert.cxx index 17bd49aa4f6f..12763d966c21 100644 --- a/compilerplugins/clang/test/doubleconvert.cxx +++ b/compilerplugins/clang/test/doubleconvert.cxx @@ -12,7 +12,7 @@ int main() { - Color col1; + constexpr Color col1; Color col2; col2 = sal_Int32( col1); // expected-error@-1 {{redundant double conversion [loplugin:doubleconvert]}} |