Skip to content

Commit 75a14c0

Browse files
Patch additional constexpr functions in ada.h for GCC 11
Change Tokenizer::get_next_code_point() and Tokenizer::seek_and_get_next_code_point() from constexpr to inline. These functions use std::string operator[] which is not constexpr in GCC 11's C++20 implementation. Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
1 parent 4b048ae commit 75a14c0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

deps/ada/ada.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5547,10 +5547,10 @@ class Tokenizer {
55475547
: input(new_input), policy(new_policy) {}
55485548

55495549
// @see https://urlpattern.spec.whatwg.org/#get-the-next-code-point
5550-
constexpr void get_next_code_point();
5550+
inline void get_next_code_point();
55515551

55525552
// @see https://urlpattern.spec.whatwg.org/#seek-and-get-the-next-code-point
5553-
constexpr void seek_and_get_next_code_point(size_t index);
5553+
inline void seek_and_get_next_code_point(size_t index);
55545554

55555555
// @see https://urlpattern.spec.whatwg.org/#add-a-token
55565556

@@ -8150,7 +8150,7 @@ constexpr bool url_aggregator::has_port() const noexcept {
81508150
buffer[components.host_end + 1] == '.';
81518151
}
81528152

8153-
[[nodiscard]] constexpr std::string_view url_aggregator::get_href()
8153+
[[nodiscard]] inline std::string_view url_aggregator::get_href()
81548154
const noexcept ada_lifetime_bound {
81558155
ada_log("url_aggregator::get_href");
81568156
return buffer;
@@ -8195,7 +8195,7 @@ ada_really_inline size_t url_aggregator::parse_port(
81958195
return consumed;
81968196
}
81978197

8198-
constexpr void url_aggregator::set_protocol_as_file() {
8198+
inline void url_aggregator::set_protocol_as_file() {
81998199
ada_log("url_aggregator::set_protocol_as_file ");
82008200
ADA_ASSERT_TRUE(validate());
82018201
type = ada::scheme::type::FILE;
@@ -9758,7 +9758,7 @@ constexpr bool constructor_string_parser<regex_provider>::is_port_prefix()
97589758
return is_non_special_pattern_char(token_index, ':');
97599759
}
97609760

9761-
constexpr void Tokenizer::get_next_code_point() {
9761+
inline void Tokenizer::get_next_code_point() {
97629762
ada_log("Tokenizer::get_next_code_point called with index=", next_index);
97639763
ADA_ASSERT_TRUE(next_index < input.size());
97649764
// this assumes that we have a valid, non-truncated UTF-8 stream.
@@ -9805,7 +9805,7 @@ constexpr void Tokenizer::get_next_code_point() {
98059805
next_index += number_bytes;
98069806
}
98079807

9808-
constexpr void Tokenizer::seek_and_get_next_code_point(size_t new_index) {
9808+
inline void Tokenizer::seek_and_get_next_code_point(size_t new_index) {
98099809
ada_log("Tokenizer::seek_and_get_next_code_point called with new_index=",
98109810
new_index);
98119811
// Set tokenizer's next index to index.

0 commit comments

Comments
 (0)