Skip to content

feat: constexpr URL parsing for C++20#976

Open
alandefreitas wants to merge 6 commits intoboostorg:developfrom
alandefreitas:fix-890
Open

feat: constexpr URL parsing for C++20#976
alandefreitas wants to merge 6 commits intoboostorg:developfrom
alandefreitas:fix-890

Conversation

@alandefreitas
Copy link
Member

fix #890

@cppalliance-bot
Copy link

cppalliance-bot commented Feb 13, 2026

An automated preview of the documentation is available at https://976.url.prtest2.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-02-17 01:55:13 UTC

@cppalliance-bot
Copy link

cppalliance-bot commented Feb 13, 2026

GCOVR code coverage report https://976.url.prtest2.cppalliance.org/gcovr/index.html
LCOV code coverage report https://976.url.prtest2.cppalliance.org/genhtml/index.html
Coverage Diff Report https://976.url.prtest2.cppalliance.org/diff-report/index.html

Build time: 2026-02-17 02:09:22 UTC

Error category classes are now fully header-only with
BOOST_SYMBOL_VISIBLE (not BOOST_URL_DECL). Virtual function
overrides are BOOST_URL_CXX20_CONSTEXPR where possible, and
category instances are inline constexpr in C++20.

Grammar rule parse functions that used BOOST_URL_CXX14_CONSTEXPR
are changed to BOOST_URL_CXX20_CONSTEXPR since constexpr URL
parsing is a C++20 feature.

BOOST_URL_CONSTEXPR_RETURN_EC now attaches source location
pre-C++20 (functions are not constexpr in that mode). Removed
dead BOOST_URL_NO_SOURCE_LOCATION code paths.

fix boostorg#890
GCC 10: detail::find_if/find_if_not used __cplusplus >= 202002L
to guard is_constant_evaluated(), but BOOST_URL_HAS_CXX20_CONSTEXPR
uses __cpp_constexpr >= 201907L. On GCC 10 these diverge, causing
non-constexpr lut_chars::find_if_not to be called in constexpr
context. Fixed by using BOOST_URL_HAS_CXX20_CONSTEXPR consistently.

MSVC: ICEs on constexpr URL parsing (C1001 in p1_init.c).
Disabled BOOST_URL_HAS_CXX20_CONSTEXPR on MSVC until the
compiler bug is fixed.
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 99.01130% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.07%. Comparing base (968127f) to head (ecad3f4).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...clude/boost/url/rfc/detail/impl/ipvfuture_rule.hpp 33.33% 2 Missing ⚠️
include/boost/url/rfc/impl/origin_form_rule.hpp 93.93% 2 Missing ⚠️
include/boost/url/detail/impl/any_params_iter.hpp 97.72% 1 Missing ⚠️
include/boost/url/rfc/detail/impl/h16_rule.hpp 50.00% 1 Missing ⚠️
...lude/boost/url/rfc/detail/impl/ip_literal_rule.hpp 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #976      +/-   ##
===========================================
- Coverage    99.11%   99.07%   -0.04%     
===========================================
  Files          162      165       +3     
  Lines        10027    10077      +50     
===========================================
+ Hits          9938     9984      +46     
- Misses          89       93       +4     
Files with missing lines Coverage Δ
doc/modules/ROOT/examples/unit/snippets.cpp 97.31% <100.00%> (+0.01%) ⬆️
include/boost/url/authority_view.hpp 100.00% <100.00%> (ø)
include/boost/url/detail/any_params_iter.hpp 100.00% <ø> (ø)
include/boost/url/detail/fnv_1a.hpp 100.00% <100.00%> (ø)
...clude/boost/url/detail/impl/segments_iter_impl.hpp 99.19% <ø> (ø)
include/boost/url/detail/impl/url_impl.hpp 100.00% <100.00%> (ø)
include/boost/url/detail/move_chars.hpp 100.00% <ø> (ø)
include/boost/url/detail/over_allocator.hpp 100.00% <ø> (ø)
include/boost/url/detail/path.hpp 98.33% <ø> (ø)
include/boost/url/detail/print.hpp 100.00% <ø> (ø)
... and 93 more

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 968127f...ecad3f4. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explore C++14 constexpr for url_view

2 participants