Generate [expected] wording from the annotated headers via specgen - #94
Open
steve-downey wants to merge 4 commits into
Open
Generate [expected] wording from the annotated headers via specgen#94steve-downey wants to merge 4 commits into
steve-downey wants to merge 4 commits into
Conversation
catch_discover_tests defaults to DISCOVERY_MODE POST_BUILD, which runs the freshly-linked (ASan-instrumented) test binaries during the ninja build itself to enumerate their test cases. Under the CodeQL Advanced workflow, CodeQL's build tracer injects its own LD_PRELOAD ahead of the ASan runtime, and ASan aborts immediately with "ASan runtime does not come first in initial library list", failing the build before analysis can run. Switching to DISCOVERY_MODE PRE_TEST moves the enumeration step to ctest invocation time instead of build time, so no instrumented binary runs while CodeQL is tracing the build. Verified locally: gcc-debug preset builds cleanly and `ctest` still discovers and passes all 1178 tests.
fix: defer Catch2 test discovery to ctest time to unblock CodeQL build
Add //! docblocks (Effects, Constraints, Mandates, Returns, Throws, Remarks) to every declaration in unexpected.hpp, bad_expected_access.hpp, and expected.hpp, sourced from the real standard text for the already-standardized members and from papers/expected-new.tex for the expected-over-references additions (unexpected<E&>, expected<T&,E>). specgen generate --validate passes cleanly on all three headers, so the headers are now a source of truth specgen can turn into wording directly.
Add papers/wording/generate.sh (wired up as `make wording`), which runs
specgen against the three headers and assembles the result two ways:
- papers/wording/fragments/*.tex: one file per top-level clause, for
\input into a standalone paper (specgen numbers a fragment's \rSec
markers one level deeper than written, so a paper's own
\rSec1[expected]{Expected objects} supplies the level these assume).
- papers/wording/expected.tex: the same content concatenated in real
standard clause order, at the draft's own absolute numbering, with no
\rSec2[expected] wrapper and no \input directives -- the basis for a
patch to source/utilities.tex in the actual C++ working draft
(github.com/cplusplus/draft), where [expected.general] and
[expected.syn] are untouched and only the subclauses from
[expected.unexpected] on are replaced/extended.
[expected.general] and [expected.syn] are prose, not generated from any
one declaration; they stay hand-authored in papers/expected-new.tex.
| \returns | ||
| \tcode{!x.has_value() && static_cast<bool>(x.error() == e.error())}. | ||
| \end{itemdescr} | ||
|
|
There was a problem hiding this comment.
[pre-commit] reported by reviewdog 🐶
Suggested change
Contributor
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
unexpected.hpp,bad_expected_access.hpp, andexpected.hppwith//!specgen docblocks (Effects, Constraints, Mandates, Returns, Throws, Remarks) for every declaration, sourced from the real standard text for already-standardized members and frompapers/expected-new.texfor the expected-over-references additions (unexpected<E&>,expected<T&,E>).specgen generate --validatepasses cleanly on all three headers.papers/wording/generate.sh(wired up asmake wording) to turn those docblocks into wording, landed two ways:papers/wording/fragments/*.tex— one file per top-level clause, for\inputinto a standalone paper.papers/wording/expected.tex— the same content concatenated in real standard clause order at the draft's own absolute numbering, with no\rSec2[expected]wrapper and no\inputdirectives — the basis for a patch tosource/utilities.texin the actual C++ working draft (cplusplus/draft), where[expected.general]and[expected.syn]stay untouched (hand-authored prose, not generated from any one declaration) and only the subclauses from[expected.unexpected]on are replaced/extended.The headers are now a source of truth specgen can turn into wording directly, instead of the wording and the implementation being able to drift apart.
Test plan
specgen generate --validatepasses on all three headerscmake --build --preset gcc-debugctest --preset gcc-debug— 1178/1178 tests passpapers/wording/expected.texread correctly against the current[expected]clause andpapers/expected-new.tex?