Skip to content

Fix string destructor chain noexcept bloat - #3904

Merged
zackees merged 1 commit into
masterfrom
fix/2975-noexcept-string-destructors
Aug 19, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/2975-noexcept-string-destructors

Conversation

@zackees

@zackees zackees commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add a destructor-only FL_DTOR_NOEXCEPT gate without re-enabling the broad compatibility-disabled FL_NO_EXCEPT macro
  • mark the complete �asic_string ownership/destruction chain nonthrowing
  • teach the noexcept lint checker to accept the new marker only on destructors and add compile-time coverage

Verification

  • �ash test tests/fl/stl/strstream.cppn- �ash test shared_ptrn- �ash test variant`n- focused Rust lint-regression test
  • �ash lint --cpp`n- �ash compile uno --examples Blink (avr-gcc 7.3.0)
  • git diff --check`n- clud-review: clean

Fixes #2975

Summary by CodeRabbit

  • New Features

    • Added dedicated FL_DTOR_NOEXCEPT support for destructor exception specifications.
    • Updated library destructors to use the dedicated annotation.
  • Bug Fixes

    • Improved linting to correctly recognize destructor-specific exception annotations and provide clearer guidance for missing annotations.
  • Tests

    • Added compile-time checks confirming noexcept destruction across strings, smart pointers, variants, streams, and related types.

@zackees
zackees merged commit 9fda1a9 into master Aug 19, 2026
10 of 17 checks passed
@zackees
zackees deleted the fix/2975-noexcept-string-destructors branch August 19, 2026 03:15
@coderabbitai

coderabbitai Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2a71412e-f1b8-4d80-b96d-99f7a23a309a

📥 Commits

Reviewing files that changed from the base of the PR and between 824205b and 397abb6.

📒 Files selected for processing (12)
  • ci/lint_cpp_rs/src/checkers/test_structure.rs
  • ci/lint_cpp_rs/src/lint_core/analysis_helpers.rs
  • ci/lint_cpp_rs/src/lint_core/regexes.rs
  • src/fl/stl/basic_string.cpp.hpp
  • src/fl/stl/basic_string.h
  • src/fl/stl/detail/string_holder.cpp.hpp
  • src/fl/stl/detail/string_holder.h
  • src/fl/stl/noexcept.h
  • src/fl/stl/shared_ptr.cpp.hpp
  • src/fl/stl/shared_ptr.h
  • src/fl/stl/variant.h
  • tests/fl/stl/strstream.cpp

📝 Walkthrough

Walkthrough

The change adds FL_DTOR_NOEXCEPT, applies it to STL destructors, adds compile-time destruction checks, and updates the C++ lint checker to recognize the destructor-specific annotation.

Changes

Destructor noexcept annotations

Layer / File(s) Summary
Destructor noexcept macro
src/fl/stl/noexcept.h
Defines the guarded FL_DTOR_NOEXCEPT macro as noexcept.
STL destructor annotations
src/fl/stl/basic_string.*, src/fl/stl/detail/string_holder.*, src/fl/stl/shared_ptr.*, src/fl/stl/variant.h, tests/fl/stl/strstream.cpp
Updates affected destructors to use FL_DTOR_NOEXCEPT. Adds compile-time noexcept assertions for destruction of string, stream, variant, and shared-pointer-related types.
Destructor annotation lint support
ci/lint_cpp_rs/src/lint_core/regexes.rs, ci/lint_cpp_rs/src/lint_core/analysis_helpers.rs, ci/lint_cpp_rs/src/checkers/test_structure.rs
Adds destructor-specific regex matching and checks destructor signatures with the dedicated marker. Updates the missing-annotation message.

Estimated code review effort: 3 (Moderate) | ~20 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/2975-noexcept-string-destructors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bloat: mark fl::basic_string + fl::sstream dtors noexcept to eliminate per-call-site landing pads

1 participant