about [UPDATING (4 days)] [MOVED (15 hours)] [vuxml (3 hours)]summaryrefslograw-logtreecommitdiffstats
path: root/www/librewolf/files/patch-languageid-de-constexpr-ify [up]
Last 15 commits to file "www/librewolf/files/patch-languageid-de-constexpr-ify" in the last year: [ Last 15 commits to this file | All commits to this file ]
 
Commit messageAuthorDateFilesLines
* [ file ]www/librewolf: Update 157.0.1-1 => 158.0-1Martin Filla2026-10-18 22:48:13 +01001-16/+18
* [ file ]www/librewolf: Update 150.0.3-1 => 151.0-1Martin Filla2026-05-20 20:27:10 +01001-0/+138


commit: (<title> <author> <date> etc.)
blob: a7a17cb9c1c90ea6811830e42e3efe06e9c88862 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
commit 386dedafa65ac0f9cf726c63fd83d47b971b459d
Author: Christoph Moench-Tegeder <cmt@FreeBSD.org>

    Partially de-constexpr'ify LanguageId code
    
    This is to deal with our (FreeBSD) libc++, where in some cases
    std:pair<> is not a "literal type" (suitable for constexpr), even
    if the same std:pair<> is just fine on all other relevant systems.
    
    This removes just enough constexpr annotations to make the code
    compile.
    
    Sample compiler error message:
    
    /wrkdirs/usr/ports/www/firefox/work/firefox-151.0/js/src/util/LanguageId.h:234:66: error: constexpr function's return type 'mozilla::Maybe<std::pair<LanguageId>
      234 |   static constexpr mozilla::Maybe<std::pair<LanguageId, size_t>> from(
          |
    /wrkdirs/usr/ports/www/firefox/work/.build/dist/include/mozilla/Maybe.h:367:7: note: 'Maybe<std::pair<js::LanguageId, unsigned long>>' is not literal because i>
      367 |     : private detail::MaybeStorage<T>,
          |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

diff --git js/src/builtin/intl/LocaleNegotiation.cpp js/src/builtin/intl/LocaleNegotiation.cpp
index d6c6a9c7760b..c23315ede19c 100644
--- js/src/builtin/intl/LocaleNegotiation.cpp
+++ js/src/builtin/intl/LocaleNegotiation.cpp
@@ -1163,13 +1163,13 @@ struct OldStyleLanguageTagMapping {
   LanguageId oldStyle;
   LanguageId modernStyle;
 
-  consteval OldStyleLanguageTagMapping(std::string_view oldStyle,
+  OldStyleLanguageTagMapping(std::string_view oldStyle,
                                        std::string_view modernStyle)
       : oldStyle(LanguageId::fromValidBcp49(oldStyle)),
         modernStyle(LanguageId::fromValidBcp49(modernStyle)) {}
 };
 
-static constexpr OldStyleLanguageTagMapping oldStyleLanguageTagMappings[] = {
+static OldStyleLanguageTagMapping oldStyleLanguageTagMappings[] = {
     {"pa-PK", "pa-Arab-PK"}, {"zh-CN", "zh-Hans-CN"}, {"zh-HK", "zh-Hant-HK"},
     {"zh-SG", "zh-Hans-SG"}, {"zh-TW", "zh-Hant-TW"},
 };
diff --git js/src/builtin/intl/SharedIntlData.cpp js/src/builtin/intl/SharedIntlData.cpp
index 5ab01896f32f..c5834175f80d 100644
--- js/src/builtin/intl/SharedIntlData.cpp
+++ js/src/builtin/intl/SharedIntlData.cpp
@@ -431,12 +431,12 @@ bool js::intl::SharedIntlData::getAvailableLocales(
   // directly support it (but does support it through fallback, e.g. supporting
   // "en-GB" indirectly using "en" support).
   {
-    static constexpr auto lastDitch = LastDitchLocale();
-    static_assert(std::string_view{lastDitch.toString()} == "en-GB");
+    static auto lastDitch = LastDitchLocale();
+    // static_assert(std::string_view{lastDitch.toString()} == "en-GB");
 
 #ifdef DEBUG
-    static constexpr auto lastDitchParent = lastDitch.parentLocale();
-    static_assert(std::string_view{lastDitchParent.toString()} == "en");
+    static auto lastDitchParent = lastDitch.parentLocale();
+    // static_assert(std::string_view{lastDitchParent.toString()} == "en");
 
     MOZ_ASSERT(locales.has(lastDitchParent),
                "shouldn't be a need to add every locale implied by the "
diff --git js/src/util/LanguageId.h js/src/util/LanguageId.h
index cb8561f952d0..f8fd1766987d 100644
--- js/src/util/LanguageId.h
+++ js/src/util/LanguageId.h
@@ -230,7 +230,7 @@ class LanguageId final {
 
  private:
   template <char... separators, typename CharT>
-  static constexpr mozilla::Maybe<std::pair<LanguageId, size_t>> from(
+  static /* constexpr */ mozilla::Maybe<std::pair<LanguageId, size_t>> from(
       std::basic_string_view<CharT> localeId) {
     // Return true iff |sv| starts with a subtag of length |len|.
     auto hasSubtag = [](std::basic_string_view<CharT> sv, size_t len) {
@@ -312,7 +312,7 @@ class LanguageId final {
    *
    * Subtags in ICU and Unicode locale identifiers are separated by "-" or "_".
    */
-  static constexpr auto fromId(std::string_view localeId) {
+  static auto fromId(std::string_view localeId) {
     return from<'-', '_'>(localeId);
   }
 
@@ -326,7 +326,7 @@ class LanguageId final {
    *
    * Subtags in ICU and Unicode locale identifiers are separated by "-" or "_".
    */
-  static constexpr auto fromId(mozilla::Span<const char> localeId) {
+  static auto fromId(mozilla::Span<const char> localeId) {
     return fromId(std::string_view{localeId.data(), localeId.size()});
   }
 
@@ -340,7 +340,7 @@ class LanguageId final {
    *
    * Subtags in BCP 47 locale identifiers are separated by "-".
    */
-  static constexpr auto fromBcp49(std::string_view localeId) {
+  static auto fromBcp49(std::string_view localeId) {
     return from<'-'>(localeId);
   }
 
@@ -354,7 +354,7 @@ class LanguageId final {
    *
    * Subtags in BCP 47 locale identifiers are separated by "-".
    */
-  static constexpr auto fromBcp49(std::u16string_view localeId) {
+  static auto fromBcp49(std::u16string_view localeId) {
     return from<u'-'>(localeId);
   }
 
@@ -369,7 +369,7 @@ class LanguageId final {
    * Subtags in BCP 47 locale identifiers are separated by "-".
    */
   template <typename CharT>
-  static constexpr auto fromBcp49(mozilla::Span<const CharT> localeId) {
+  static auto fromBcp49(mozilla::Span<const CharT> localeId) {
     return fromBcp49(std::basic_string_view{localeId.data(), localeId.size()});
   }
 
@@ -380,7 +380,7 @@ class LanguageId final {
    *
    * Subtags in BCP 47 locale identifiers are separated by "-".
    */
-  static consteval auto fromValidBcp49(std::string_view localeId) {
+  static auto fromValidBcp49(std::string_view localeId) {
     return fromBcp49(localeId)->first;
   }
 
@@ -407,8 +407,8 @@ class LanguageId final {
   /**
    * Return the language identifier for the undetermined locale "und".
    */
-  static constexpr auto und() {
-    constexpr LanguageId locale = fromValidBcp49("und");
+  static auto und() {
+    LanguageId locale = fromValidBcp49("und");
     return locale;
   }
 
This site is maintained by Jamie Landeg-Jones <jamie@catflap.org>, and is not an official FreeBSD project, nor is it endorsed by the FreeBSD team.