Skip to content
Commit 8affee24 authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr
Browse files

Fix compilation with GCC 9



Fixes build error with GCC 9 of:

| /opt/yocto/kde/nanbield/build-visionfive2/tmp/work/x86_64-linux/ki18n-native/6.0.0/ki18n-6.0.0/src/localedata/timezonedata.cpp:15:34: error: non-constant condition for static assertion
|    15 | static_assert(isSortedLookupTable(country_timezone_map));
|       |               ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
| /opt/yocto/kde/nanbield/build-visionfive2/tmp/work/x86_64-linux/ki18n-native/6.0.0/ki18n-6.0.0/src/localedata/timezonedata.cpp:15:34: error: ‘constexpr bool isSortedLookupTable(const MapEntry (&)[N]) [with MapEntry = MapEntry<short unsigned int>; long unsigned int N = 214]’ called in a constant expression
| In file included from /opt/yocto/kde/nanbield/build-visionfive2/tmp/work/x86_64-linux/ki18n-native/6.0.0/ki18n-6.0.0/src/localedata/timezonedata_p.h:10,
|                  from /opt/yocto/kde/nanbield/build-visionfive2/tmp/work/x86_64-linux/ki18n-native/6.0.0/ki18n-6.0.0/src/localedata/timezonedata.cpp:7:
| /opt/yocto/kde/nanbield/build-visionfive2/tmp/work/x86_64-linux/ki18n-native/6.0.0/ki18n-6.0.0/src/localedata/mapentry_p.h:42:23: note: ‘constexpr bool isSortedLookupTable(const MapEntry (&)[N]) [with MapEntry = MapEntry<short unsigned int>; long unsigned int N = 214]’ is not usable as a ‘constexpr’ function because:
|    42 | inline constexpr bool isSortedLookupTable(const MapEntry (&map)[N])
|       |                       ^~~~~~~~~~~~~~~~~~~
| /opt/yocto/kde/nanbield/build-visionfive2/tmp/work/x86_64-linux/ki18n-native/6.0.0/ki18n-6.0.0/src/localedata/mapentry_p.h:45:26: error: call to non-‘constexpr’ function ‘bool std::is_sorted(_FIter, _FIter) [with _FIter = const MapEntry<short unsigned int>*]’
|    45 |     return std::is_sorted(std::begin(map), std::end(map));
|       |            ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: default avatarAndreas Cord-Landwehr <cordlandwehr@kde.org>
parent a0839c42
Pipeline #622417 passed with stage
in 5 minutes and 6 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment