Skip to content

Read a bare negative number as a positional value in rfl::cli - #16

Closed
clockblocker wants to merge 1 commit into
mainfrom
cli-negative-number-positional
Closed

clockblocker wants to merge 1 commit into
mainfrom
cli-negative-number-positional

Conversation

@clockblocker

@clockblocker clockblocker commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

AI-authored

A bare negative number could not be passed as a positional value. With rfl::Positional<int> count, reading {"program", "-5"} failed with Unknown short argument: -5, and -.5 failed the same way for a double. parse_argv sent every token that starts with - to the short-option branch.

The short-option branch now checks looks_like_option(arg_raw), the same check the value lookahead already used. A - followed by a digit or . (-5, -1.5, -1e3) is no longer an option, so the token falls through to the positional arguments.

Digit short options keep working. As in argparse, the rule is off when the struct declares a short option whose name looks like a number: with rfl::Short<"1", std::optional<bool>>, ls -1 sets the flag as on main, and a -<digit> token is a short option, so a negative positional needs -- (ls -1 -- -5). Right after a short option, such a token is still that option's value, as on main: with rfl::Short<"n", int>, -n -1 sets n to -1. rfl::cli::read passes that one bit to the parser (internal::parse_args). The public parse_argv, which doesn't know the struct, is unchanged from main: -<digit>… tokens are short options there (-1 x gives -1 = x).

Other short options (-v, -x=value, -x value) are unaffected. -inf and -nan start with a letter, so they stay short options; cli.md now says to pass them after -- or as --key=-inf. --x=-5 and -n -5 already worked and are now tested.

Tests in tests/cli/test_positional.cpp: test_positional_negative_numbers, test_positional_negative_number_forms (-10, -0, -1.5, -1e3), test_positional_negative_infinity_needs_separator, test_negative_option_values, test_digit_short_option, test_digit_short_option_makes_negative_numbers_options, test_parse_argv_reads_negative_numbers_as_options. All 79 cli tests pass; every cli test file compiles with GCC 16 -Wall -Werror.

🤖 Generated with Claude Code

`-5` or `-.5` on its own was parsed as a short option and failed with
"Unknown short argument". The short-option branch now uses
looks_like_option(), which the value lookahead already used.

As in argparse, this does not apply if the struct has a short option
whose name looks like a number, such as rfl::Short<"1", bool> for
`ls -1`: then such tokens are short options as before, and negative
positionals need `--`. rfl::cli::read passes that one bit to the parser.
The public parse_argv, which does not know the struct, still reads such
tokens as short options, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@clockblocker
clockblocker force-pushed the cli-negative-number-positional branch from dc4b898 to 99500f4 Compare November 13, 2026 23:06
@clockblocker

Copy link
Copy Markdown
Owner Author

Superseded by the wave chain: #17. This PR's content was split into smaller single-purpose PRs and reworked; the old branch is left in place.

clockblocker added a commit that referenced this pull request Nov 28, 2026
…#120)

Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135).

Polish from audit #16:
- Preserve Wave 1A <sstream> elimination across PatternValidator.hpp,
  comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp.
- Move builtin_error_code_str, parse_builtin_error_code, compose_size_code,
  and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp
  (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to
  trim Error.hpp compile-time weight.
- Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator
  key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with
  const std::exception& and catch (...).
- Guard constant nullptr V::code in validator_code.hpp with if constexpr to
  avoid GCC 13 -Werror=nonnull.
- Add ASan+UBSan unit test coverage for non-std::exception throws in
  Validator, AllOf, and MapReader.
clockblocker added a commit that referenced this pull request Nov 29, 2026
…c storage (#70)

Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation
(handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field)
and Wave 1A header trims.

Polish from audit #16:
- Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows
  adding it alongside duplicate-key readers / rfl::Alias in Wave 5).
- Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports
  ErrorKind::invalid_value via from_reflection without throwing or adding a
  one-off is_timestamp_v branch in Parser_default.hpp.
- Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader,
  Validator, Timestamp, ParserTimePoint, Parser_default) with const
  std::exception& and catch (...).
- Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp
  to avoid ADL ambiguity when reflecting structs in rfl::internal (such as
  rfl::ErrorDetail).
- Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix
  GCC 13 -Werror=unused-local-typedefs.
clockblocker added a commit that referenced this pull request Nov 29, 2026
…#120)

Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135).

Polish from audit #16:
- Preserve Wave 1A <sstream> elimination across PatternValidator.hpp,
  comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp.
- Move builtin_error_code_str, parse_builtin_error_code, compose_size_code,
  and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp
  (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to
  trim Error.hpp compile-time weight.
- Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator
  key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with
  const std::exception& and catch (...).
- Guard constant nullptr V::code in validator_code.hpp with if constexpr to
  avoid GCC 13 -Werror=nonnull.
- Add ASan+UBSan unit test coverage for non-std::exception throws in
  Validator, AllOf, and MapReader.
clockblocker added a commit that referenced this pull request Nov 29, 2026
…c storage (#70)

Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation
(handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field)
and Wave 1A header trims.

Polish from audit #16:
- Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows
  adding it alongside duplicate-key readers / rfl::Alias in Wave 5).
- Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports
  ErrorKind::invalid_value via from_reflection without throwing or adding a
  one-off is_timestamp_v branch in Parser_default.hpp.
- Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader,
  Validator, Timestamp, ParserTimePoint, Parser_default) with const
  std::exception& and catch (...).
- Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp
  to avoid ADL ambiguity when reflecting structs in rfl::internal (such as
  rfl::ErrorDetail).
- Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix
  GCC 13 -Werror=unused-local-typedefs.
clockblocker added a commit that referenced this pull request Nov 29, 2026
…#120)

Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135).

Polish from audit #16:
- Preserve Wave 1A <sstream> elimination across PatternValidator.hpp,
  comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp.
- Move builtin_error_code_str, parse_builtin_error_code, compose_size_code,
  and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp
  (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to
  trim Error.hpp compile-time weight.
- Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator
  key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with
  const std::exception& and catch (...).
- Guard constant nullptr V::code in validator_code.hpp with if constexpr to
  avoid GCC 13 -Werror=nonnull.
- Add ASan+UBSan unit test coverage for non-std::exception throws in
  Validator, AllOf, and MapReader.
clockblocker added a commit that referenced this pull request Nov 29, 2026
…c storage (#70)

Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation
(handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field)
and Wave 1A header trims.

Polish from audit #16:
- Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows
  adding it alongside duplicate-key readers / rfl::Alias in Wave 5).
- Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports
  ErrorKind::invalid_value via from_reflection without throwing or adding a
  one-off is_timestamp_v branch in Parser_default.hpp.
- Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader,
  Validator, Timestamp, ParserTimePoint, Parser_default) with const
  std::exception& and catch (...).
- Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp
  to avoid ADL ambiguity when reflecting structs in rfl::internal (such as
  rfl::ErrorDetail).
- Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix
  GCC 13 -Werror=unused-local-typedefs.
clockblocker added a commit that referenced this pull request Nov 29, 2026
…#120)

Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135).

Polish from audit #16:
- Preserve Wave 1A <sstream> elimination across PatternValidator.hpp,
  comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp.
- Move builtin_error_code_str, parse_builtin_error_code, compose_size_code,
  and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp
  (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to
  trim Error.hpp compile-time weight.
- Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator
  key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with
  const std::exception& and catch (...).
- Guard constant nullptr V::code in validator_code.hpp with if constexpr to
  avoid GCC 13 -Werror=nonnull.
- Add ASan+UBSan unit test coverage for non-std::exception throws in
  Validator, AllOf, and MapReader.
clockblocker added a commit that referenced this pull request Nov 29, 2026
…c storage (#70)

Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation
(handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field)
and Wave 1A header trims.

Polish from audit #16:
- Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows
  adding it alongside duplicate-key readers / rfl::Alias in Wave 5).
- Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports
  ErrorKind::invalid_value via from_reflection without throwing or adding a
  one-off is_timestamp_v branch in Parser_default.hpp.
- Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader,
  Validator, Timestamp, ParserTimePoint, Parser_default) with const
  std::exception& and catch (...).
- Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp
  to avoid ADL ambiguity when reflecting structs in rfl::internal (such as
  rfl::ErrorDetail).
- Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix
  GCC 13 -Werror=unused-local-typedefs.
clockblocker added a commit that referenced this pull request Nov 29, 2026
…#120)

Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135).

Polish from audit #16:
- Preserve Wave 1A <sstream> elimination across PatternValidator.hpp,
  comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp.
- Move builtin_error_code_str, parse_builtin_error_code, compose_size_code,
  and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp
  (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to
  trim Error.hpp compile-time weight.
- Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator
  key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with
  const std::exception& and catch (...).
- Guard constant nullptr V::code in validator_code.hpp with if constexpr to
  avoid GCC 13 -Werror=nonnull.
- Add ASan+UBSan unit test coverage for non-std::exception throws in
  Validator, AllOf, and MapReader.
clockblocker added a commit that referenced this pull request Nov 29, 2026
…c storage (#70)

Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation
(handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field)
and Wave 1A header trims.

Polish from audit #16:
- Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows
  adding it alongside duplicate-key readers / rfl::Alias in Wave 5).
- Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports
  ErrorKind::invalid_value via from_reflection without throwing or adding a
  one-off is_timestamp_v branch in Parser_default.hpp.
- Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader,
  Validator, Timestamp, ParserTimePoint, Parser_default) with const
  std::exception& and catch (...).
- Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp
  to avoid ADL ambiguity when reflecting structs in rfl::internal (such as
  rfl::ErrorDetail).
- Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix
  GCC 13 -Werror=unused-local-typedefs.
clockblocker added a commit that referenced this pull request Nov 29, 2026
…#120)

Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135).

Polish from audit #16:
- Preserve Wave 1A <sstream> elimination across PatternValidator.hpp,
  comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp.
- Move builtin_error_code_str, parse_builtin_error_code, compose_size_code,
  and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp
  (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to
  trim Error.hpp compile-time weight.
- Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator
  key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with
  const std::exception& and catch (...).
- Guard constant nullptr V::code in validator_code.hpp with if constexpr to
  avoid GCC 13 -Werror=nonnull.
- Add ASan+UBSan unit test coverage for non-std::exception throws in
  Validator, AllOf, and MapReader.
clockblocker added a commit that referenced this pull request Nov 30, 2026
…c storage (#70)

Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation
(handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field)
and Wave 1A header trims.

Polish from audit #16:
- Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows
  adding it alongside duplicate-key readers / rfl::Alias in Wave 5).
- Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports
  ErrorKind::invalid_value via from_reflection without throwing or adding a
  one-off is_timestamp_v branch in Parser_default.hpp.
- Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader,
  Validator, Timestamp, ParserTimePoint, Parser_default) with const
  std::exception& and catch (...).
- Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp
  to avoid ADL ambiguity when reflecting structs in rfl::internal (such as
  rfl::ErrorDetail).
- Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix
  GCC 13 -Werror=unused-local-typedefs.
clockblocker added a commit that referenced this pull request Nov 30, 2026
…#120)

Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135).

Polish from audit #16:
- Preserve Wave 1A <sstream> elimination across PatternValidator.hpp,
  comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp.
- Move builtin_error_code_str, parse_builtin_error_code, compose_size_code,
  and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp
  (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to
  trim Error.hpp compile-time weight.
- Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator
  key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with
  const std::exception& and catch (...).
- Guard constant nullptr V::code in validator_code.hpp with if constexpr to
  avoid GCC 13 -Werror=nonnull.
- Add ASan+UBSan unit test coverage for non-std::exception throws in
  Validator, AllOf, and MapReader.
clockblocker added a commit that referenced this pull request Nov 30, 2026
…c storage (#70)

Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation
(handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field)
and Wave 1A header trims.

Polish from audit #16:
- Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows
  adding it alongside duplicate-key readers / rfl::Alias in Wave 5).
- Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports
  ErrorKind::invalid_value via from_reflection without throwing or adding a
  one-off is_timestamp_v branch in Parser_default.hpp.
- Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader,
  Validator, Timestamp, ParserTimePoint, Parser_default) with const
  std::exception& and catch (...).
- Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp
  to avoid ADL ambiguity when reflecting structs in rfl::internal (such as
  rfl::ErrorDetail).
- Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix
  GCC 13 -Werror=unused-local-typedefs.
clockblocker added a commit that referenced this pull request Nov 30, 2026
…#120)

Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135).

Polish from audit #16:
- Preserve Wave 1A <sstream> elimination across PatternValidator.hpp,
  comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp.
- Move builtin_error_code_str, parse_builtin_error_code, compose_size_code,
  and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp
  (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to
  trim Error.hpp compile-time weight.
- Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator
  key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with
  const std::exception& and catch (...).
- Guard constant nullptr V::code in validator_code.hpp with if constexpr to
  avoid GCC 13 -Werror=nonnull.
- Add ASan+UBSan unit test coverage for non-std::exception throws in
  Validator, AllOf, and MapReader.
clockblocker added a commit that referenced this pull request Nov 30, 2026
…c storage (#70)

Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation
(handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field)
and Wave 1A header trims.

Polish from audit #16:
- Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows
  adding it alongside duplicate-key readers / rfl::Alias in Wave 5).
- Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports
  ErrorKind::invalid_value via from_reflection without throwing or adding a
  one-off is_timestamp_v branch in Parser_default.hpp.
- Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader,
  Validator, Timestamp, ParserTimePoint, Parser_default) with const
  std::exception& and catch (...).
- Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp
  to avoid ADL ambiguity when reflecting structs in rfl::internal (such as
  rfl::ErrorDetail).
- Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix
  GCC 13 -Werror=unused-local-typedefs.
clockblocker added a commit that referenced this pull request Nov 30, 2026
…#120)

Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135).

Polish from audit #16:
- Preserve Wave 1A <sstream> elimination across PatternValidator.hpp,
  comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp.
- Move builtin_error_code_str, parse_builtin_error_code, compose_size_code,
  and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp
  (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to
  trim Error.hpp compile-time weight.
- Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator
  key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with
  const std::exception& and catch (...).
- Guard constant nullptr V::code in validator_code.hpp with if constexpr to
  avoid GCC 13 -Werror=nonnull.
- Add ASan+UBSan unit test coverage for non-std::exception throws in
  Validator, AllOf, and MapReader.
clockblocker added a commit that referenced this pull request Dec 1, 2026
…c storage (#70)

Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation
(handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field)
and Wave 1A header trims.

Polish from audit #16:
- Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows
  adding it alongside duplicate-key readers / rfl::Alias in Wave 5).
- Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports
  ErrorKind::invalid_value via from_reflection without throwing or adding a
  one-off is_timestamp_v branch in Parser_default.hpp.
- Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader,
  Validator, Timestamp, ParserTimePoint, Parser_default) with const
  std::exception& and catch (...).
- Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp
  to avoid ADL ambiguity when reflecting structs in rfl::internal (such as
  rfl::ErrorDetail).
- Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix
  GCC 13 -Werror=unused-local-typedefs.
clockblocker added a commit that referenced this pull request Dec 1, 2026
…#120)

Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135).

Polish from audit #16:
- Preserve Wave 1A <sstream> elimination across PatternValidator.hpp,
  comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp.
- Move builtin_error_code_str, parse_builtin_error_code, compose_size_code,
  and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp
  (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to
  trim Error.hpp compile-time weight.
- Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator
  key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with
  const std::exception& and catch (...).
- Guard constant nullptr V::code in validator_code.hpp with if constexpr to
  avoid GCC 13 -Werror=nonnull.
- Add ASan+UBSan unit test coverage for non-std::exception throws in
  Validator, AllOf, and MapReader.
clockblocker added a commit that referenced this pull request Dec 1, 2026
…c storage (#70)

Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation
(handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field)
and Wave 1A header trims.

Polish from audit #16:
- Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows
  adding it alongside duplicate-key readers / rfl::Alias in Wave 5).
- Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports
  ErrorKind::invalid_value via from_reflection without throwing or adding a
  one-off is_timestamp_v branch in Parser_default.hpp.
- Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader,
  Validator, Timestamp, ParserTimePoint, Parser_default) with const
  std::exception& and catch (...).
- Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp
  to avoid ADL ambiguity when reflecting structs in rfl::internal (such as
  rfl::ErrorDetail).
- Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix
  GCC 13 -Werror=unused-local-typedefs.
clockblocker added a commit that referenced this pull request Dec 1, 2026
…#120)

Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135).

Polish from audit #16:
- Preserve Wave 1A <sstream> elimination across PatternValidator.hpp,
  comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp.
- Move builtin_error_code_str, parse_builtin_error_code, compose_size_code,
  and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp
  (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to
  trim Error.hpp compile-time weight.
- Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator
  key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with
  const std::exception& and catch (...).
- Guard constant nullptr V::code in validator_code.hpp with if constexpr to
  avoid GCC 13 -Werror=nonnull.
- Add ASan+UBSan unit test coverage for non-std::exception throws in
  Validator, AllOf, and MapReader.
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.

1 participant