From b9f43acf9c4f2f800456bb19a5fd0879541cabc6 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 6 Dec 2019 23:28:33 +0100 Subject: Better not use constexpr here With a locally modified include/o3tl/optional.hxx to always pick the boost::optional branch, to prepare "Fix more new dependencies on boost_headers", that constexpr caused > In file included from idlc/source/errorhandler.cxx:20: > In file included from idlc/inc/errorhandler.hxx:23: > In file included from idlc/inc/astexpression.hxx:27: > include/o3tl/optional.hxx:28:23: error: constexpr variable cannot have non-literal type 'const boost::none_t' > inline constexpr auto nullopt = boost::none; > ^ > workdir/UnpackedTarball/boost/boost/none_t.hpp:29:8: note: 'none_t' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors > struct none_t > ^ at least with recent Clang 10 trunk and --without-system-boost. Change-Id: I679a6ca5d135d3f5571845a15afe20d28a1f9039 Reviewed-on: https://gerrit.libreoffice.org/84673 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- include/o3tl/optional.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/o3tl/optional.hxx b/include/o3tl/optional.hxx index 6da85698c2d8..524818230e3e 100644 --- a/include/o3tl/optional.hxx +++ b/include/o3tl/optional.hxx @@ -25,7 +25,7 @@ namespace o3tl using boost::make_optional; using boost::optional; -inline constexpr auto nullopt = boost::none; +inline auto const nullopt = boost::none; } #else -- cgit v1.2.3