Skip to content

Enable setting language standard C++26 - #276

Merged
jefftrull merged 2 commits into
boostorg:developfrom
martis42:allow_setting_language_standard_cpp26
Oct 26, 2026
Merged

jefftrull merged 2 commits into
boostorg:developfrom
martis42:allow_setting_language_standard_cpp26

Conversation

@martis42

@martis42 martis42 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Related to #263

boost.wave is not yet able to preprocess C++26 specific features like #embed.
However, using the C++26 language mode allows preprocessing code which requires __cplusplus to be set according to C++26. Also, adding the boilerplate now makes it easier add later support for the C++26 specific language features.

This contribution also fixes an already existing bug in the second commit.
We realized cpp_macromap has an existing bug in C++23 mode. When using C++23 BOOST_WAVE_SUPPORT_CPP2A would be true, but need_cpp2a() is false (also need_cpp26 would be false now that we added it). That means, we would not enter branches we are supposed to go into. Adding an additional need_cpp2b() into the or chains fixes this bug.

boost.wave is not yet able to preprocess C++26 specific features like
`#embed`.
However, using the C++26 language mode allows preprocessing code which
requires `__cplusplus` to be set according to C++26. Also, adding the
boilerplate now makes it easier add later support for the C++26 specific
language features.
While adding C++26 support we realized cpp_macromap has an existing bug
in C++23 mode. When using C++23 `BOOST_WAVE_SUPPORT_CPP2A` would be true,
but `need_cpp2a()` is false (also `need_cpp26` would be false now that we
added it). That means, we would not enter branches we are supposed to go
into. Adding an additional `need_cpp2b()` into the ro chains fixes this
bug.
@codecov

codecov Bot commented Oct 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 43.24324% with 21 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@e947f3e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
include/boost/wave/util/cpp_macromap.hpp 16.66% 4 Missing and 6 partials ⚠️
include/boost/wave/util/cpp_macromap_predef.hpp 0.00% 3 Missing ⚠️
samples/cpp_tokens/slex/cpp_slex_lexer.hpp 0.00% 0 Missing and 2 partials ⚠️
samples/list_includes/lexertl/lexertl_lexer.hpp 0.00% 0 Missing and 2 partials ⚠️
samples/token_statistics/xlex/xlex_lexer.hpp 0.00% 0 Missing and 2 partials ⚠️
test/testwave/testwave_app.cpp 33.33% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #276   +/-   ##
==========================================
  Coverage           ?   33.92%           
==========================================
  Files              ?       76           
  Lines              ?     7419           
  Branches           ?     4121           
==========================================
  Hits               ?     2517           
  Misses             ?     2375           
  Partials           ?     2527           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@jefftrull
jefftrull merged commit 29d4421 into boostorg:develop Oct 26, 2026
59 checks passed
@jefftrull

Copy link
Copy Markdown
Collaborator

Thank you for the helpful contribution!

jefftrull pushed a commit that referenced this pull request Oct 26, 2026
* Enable setting language standard C++26

boost.wave is not yet able to preprocess C++26 specific features like
`#embed`.
However, using the C++26 language mode allows preprocessing code which
requires `__cplusplus` to be set according to C++26. Also, adding the
boilerplate now makes it easier add later support for the C++26 specific
language features.

* Fix logic bug in macromap for C++23

While adding C++26 support we realized cpp_macromap has an existing bug
in C++23 mode. When using C++23 `BOOST_WAVE_SUPPORT_CPP2A` would be true,
but `need_cpp2a()` is false (also `need_cpp26` would be false now that we
added it). That means, we would not enter branches we are supposed to go
into. Adding an additional `need_cpp2b()` into the ro chains fixes this
bug.
jefftrull pushed a commit that referenced this pull request Oct 26, 2026
* Enable setting language standard C++26

boost.wave is not yet able to preprocess C++26 specific features like
`#embed`.
However, using the C++26 language mode allows preprocessing code which
requires `__cplusplus` to be set according to C++26. Also, adding the
boilerplate now makes it easier add later support for the C++26 specific
language features.

* Fix logic bug in macromap for C++23

While adding C++26 support we realized cpp_macromap has an existing bug
in C++23 mode. When using C++23 `BOOST_WAVE_SUPPORT_CPP2A` would be true,
but `need_cpp2a()` is false (also `need_cpp26` would be false now that we
added it). That means, we would not enter branches we are supposed to go
into. Adding an additional `need_cpp2b()` into the ro chains fixes this
bug.
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.

2 participants