Skip to content

Build and test CETLVaSt with GCC 7, and run GCC 7 in CI (#136, #149) - #239

Merged
thirtytwobits merged 2 commits into
mainfrom
claude/interesting-jennings-30aa49
Oct 17, 2026
Merged

thirtytwobits merged 2 commits into
mainfrom
claude/interesting-jennings-30aa49

Conversation

@thirtytwobits

@thirtytwobits thirtytwobits commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Makes the full CETLVaSt suite build and pass with GCC 7 (7.5.0), and adds GCC 7 to CI. The Arduino ecosystem is still on GCC 7, so this is a step toward embedded/Arduino support. Refs #149, refs #136.

Changes

Library

  • type_traits_ext.hpp (is_convertible_without_narrowing static assert is failing in some cases with GCC v7.3.1 #136): is_convertible_without_narrowing is now spelled as copy-list-initialization of a by-value function parameter. GCC 7 rejects the old std::array<To, 1>{{{from}}} for scalar To. GCC 7 doesn't diagnose narrowing in constructor arguments during list-initialization of a class type, so for that case it now behaves like std::variant. The trait docs and test_type_traits_ext.cpp describe this. This commit (0ad3b87) is the fix that was sitting uncommitted on the issue/136 working tree. If is_convertible_without_narrowing static assert is failing in some cases with GCC v7.3.1 #136 lands separately, drop it.
  • pf20/span.hpp: the CDE_span_002 debug assert now casts the iterator distance to size_type explicitly before comparing it with Extent. The comparison already did this conversion implicitly, so behaviour is the same on every compiler. GCC 7 flags the implicit version with -Wsign-conversion (Debug builds only).

Tests only

  • test_variable_length_array_exception_safety.cpp: GCC 7 deduces const auto list = {Value{...}, ...} as std::initializer_list<const Value> (GCC PR c++/63149, fixed in GCC 8), so no constructor matched. VariableLengthArray itself is correct. The fix is to spell out std::initializer_list<Value>, both in the constructor test and in the initializer-list assignment test that Complete VLA range and initializer-list assignment #238 added.
  • pmr/test_pmr_function.cpp: clear functions with = nullptr instead of = {}. Both resolve to operator=(std::nullptr_t), but GCC 7 reports the {} form under -Wzero-as-null-pointer-constant.

CI

  • .github/workflows/cetlvast.yml: adds a gcc7-native / cpp-14 entry to the arm64 verification matrix through include:, so GCC 7 isn't combined with cpp-17/20. It uploads the same artifacts as the other entries. The gcc7-native presets only exist for cpp-14.

Verification

Rebased onto main after #238 and re-verified:

  • cmake --workflow --preset workflow-gcc7-native-cpp-14-offline passes end to end in ghcr.io/opencyphal/toolshed:ts24.4.3 (aarch64) from a clean build dir. All 5 steps pass, including run_unittests and run_examples in Release, ReleaseEP, Debug and DebugEP: 216 passing suite runs.
  • Host workflow-gcc-native-cpp-14-offline (Homebrew GCC 13.4, macOS) passes end to end, also 216 passing suite runs. Clang and the other standards are left to CI.
  • Changed lines pass the toolshed's clang-format (clang-format-diff with clang-format 19.1.7).

🤖 Generated with Claude Code

thirtytwobits and others added 2 commits October 17, 2026 13:17
Re-spell the trait as copy-list-initialization of a by-value function
parameter; GCC 7 rejects std::array<To, 1>{{{from}}} for scalar To.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- span: compare the iterator distance to Extent as size_type explicitly in
  the CDE_span_002 debug assert. This is the conversion the comparison
  already did implicitly; GCC 7 flags it with -Wsign-conversion.
- VLA exception-safety test: spell the initializer list's type out.
  GCC 7 deduces `const auto list = {...}` as
  std::initializer_list<const Value> (GCC PR c++/63149, fixed in GCC 8),
  which no VariableLengthArray constructor takes.
- pmr::function test: clear functions with `= nullptr` instead of `= {}`,
  which GCC 7 reports under -Wzero-as-null-pointer-constant.
- CI: add gcc7-native / cpp-14 to the arm64 verification matrix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thirtytwobits
thirtytwobits force-pushed the claude/interesting-jennings-30aa49 branch from d1a0905 to f7a6e97 Compare October 17, 2026 20:25

@MAMONTBOT MAMONTBOT left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changes; no blocking issues found.

@thirtytwobits
thirtytwobits merged commit d40f6ff into main Oct 17, 2026
29 checks passed
@thirtytwobits
thirtytwobits deleted the claude/interesting-jennings-30aa49 branch October 17, 2026 21:35
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