File: constexpr.patch

package info (click to toggle)
chromium 141.0.7390.107-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 6,254,812 kB
  • sloc: cpp: 35,264,957; ansic: 7,169,920; javascript: 4,250,185; python: 1,460,636; asm: 950,788; xml: 751,751; pascal: 187,972; sh: 89,459; perl: 88,691; objc: 79,953; sql: 53,924; cs: 44,622; fortran: 24,137; makefile: 22,319; tcl: 15,277; php: 14,018; yacc: 8,995; ruby: 7,553; awk: 3,720; lisp: 3,096; lex: 1,330; ada: 727; jsp: 228; sed: 36
file content (103 lines) | stat: -rw-r--r-- 5,568 bytes parent folder | download | duplicates (2)
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
author: Andres Salomon <dilinger@debian.org>

../../services/network/shared_dictionary/simple_url_pattern_matcher.cc:31:34: error: constexpr variable 'kDefaultOptions' must be initialized by a constant expression
   31 | constexpr liburlpattern::Options kDefaultOptions = {.delimiter_list = "",
      |                                  ^                 ~~~~~~~~~~~~~~~~~~~~~~
   32 |                                                     .prefix_list = "",
      |                                                     ~~~~~~~~~~~~~~~~~~
   33 |                                                     .sensitive = true,
      |                                                     ~~~~~~~~~~~~~~~~~~
   34 |                                                     .strict = true};
      |                                                     ~~~~~~~~~~~~~~~

--- a/services/network/shared_dictionary/simple_url_pattern_matcher.cc
+++ b/services/network/shared_dictionary/simple_url_pattern_matcher.cc
@@ -28,17 +28,17 @@ namespace network {
 namespace {
 
 // https://urlpattern.spec.whatwg.org/#default-options
-constexpr liburlpattern::Options kDefaultOptions = {.delimiter_list = "",
+const liburlpattern::Options kDefaultOptions = {.delimiter_list = "",
                                                     .prefix_list = "",
                                                     .sensitive = true,
                                                     .strict = true};
 // https://urlpattern.spec.whatwg.org/#hostname-options
-constexpr liburlpattern::Options kHostnameOptions = {.delimiter_list = ".",
+const liburlpattern::Options kHostnameOptions = {.delimiter_list = ".",
                                                      .prefix_list = "",
                                                      .sensitive = true,
                                                      .strict = true};
 // https://urlpattern.spec.whatwg.org/#pathname-options
-constexpr liburlpattern::Options kPathnameOptions = {.delimiter_list = "/",
+const liburlpattern::Options kPathnameOptions = {.delimiter_list = "/",
                                                      .prefix_list = "/",
                                                      .sensitive = true,
                                                      .strict = true};
--- a/components/autofill/core/browser/data_model/addresses/autofill_i18n_api.h
+++ b/components/autofill/core/browser/data_model/addresses/autofill_i18n_api.h
@@ -16,8 +16,8 @@ namespace autofill::i18n_model_definitio
 // Country code that represents autofill's legacy address hierarchy model as
 // stored `kAutofillModelRules`. As a workaround for GCC we declare the
 // std::string constexpr first.
-constexpr inline std::string kLegacyHierarchyCountryCodeString{"XX"};
-constexpr AddressCountryCode kLegacyHierarchyCountryCode =
+[[clang::no_destroy]] const inline std::string kLegacyHierarchyCountryCodeString{"XX"};
+[[clang::no_destroy]] const AddressCountryCode kLegacyHierarchyCountryCode =
     AddressCountryCode(kLegacyHierarchyCountryCodeString);
 
 // Creates an instance of the address hierarchy model corresponding to the
--- a/components/omnibox/browser/on_device_tail_model_service.cc
+++ b/components/omnibox/browser/on_device_tail_model_service.cc
@@ -26,7 +26,7 @@
 
 namespace {
 // Constants for TFlite model validation.
-constexpr std::string kTestPrefix = "google m";
+const std::string kTestPrefix = "google m";
 constexpr std::string_view kModelValidationSwitchName =
     "omnibox-on-device-tail-model-validation";
 
--- a/chrome/browser/ui/lens/lens_overlay_url_builder.cc
+++ b/chrome/browser/ui/lens/lens_overlay_url_builder.cc
@@ -89,7 +89,7 @@ inline constexpr char kXSRFTokenQueryPar
 inline constexpr char kSecActQueryParamKey[] = "sec_act";
 
 // The list of query parameters to ignore when comparing search URLs.
-inline constexpr std::string kIgnoredSearchUrlQueryParameters[] = {
+inline const std::string kIgnoredSearchUrlQueryParameters[] = {
     kViewportWidthQueryParamKey, kViewportHeightQueryParamKey,
     kXSRFTokenQueryParamKey,     kSecActQueryParamKey,
     kModeParameterKey,           kToolbeltModeParameterKey};
--- a/content/public/test/prefetch_test_util.h
+++ b/content/public/test/prefetch_test_util.h
@@ -15,7 +15,7 @@ namespace content::test {
 
 using PrefetchContainerIdForTesting =
     base::StrongAlias<class PrefetchContainerIdForTestingTag, std::string>;
-inline constexpr PrefetchContainerIdForTesting
+inline const PrefetchContainerIdForTesting
     InvalidPrefetchContainerIdForTesting = PrefetchContainerIdForTesting("");
 
 class TestPrefetchWatcherImpl;
--- a/components/history_embeddings/ml_answerer.cc
+++ b/components/history_embeddings/ml_answerer.cc
@@ -28,7 +28,7 @@ using optimization_guide::proto::Passage
 
 namespace {
 
-static constexpr std::string kPassageIdToken = "ID";
+static const std::string kPassageIdToken = "ID";
 // Estimated token count of the preamble text in prompt.
 static constexpr size_t kPreambleTokenBufferSize = 100u;
 // Estimated token count of overhead text per passage.
--- a/chrome/browser/ui/views/tabs/recent_activity_bubble_dialog_view.cc
+++ b/chrome/browser/ui/views/tabs/recent_activity_bubble_dialog_view.cc
@@ -72,7 +72,7 @@ using collaboration::messaging::TabMessa
 namespace {
 
 // Unicode value for a bullet point.
-constexpr std::u16string kBulletPoint = u"\u2022";
+const std::u16string kBulletPoint = u"\u2022";
 constexpr int bubble_content_margin_px = 20;
 
 // Returns the correct user that should be used for a given log item.