Skip to content

fix(clang-tidy): use dynamic_cast for downcast in HandleResponse - #1316

Merged
castler merged 1 commit into
eclipse-score:mainfrom
castler:fix_static_cast_downcast
Oct 7, 2026
Merged

castler merged 1 commit into
eclipse-score:mainfrom
castler:fix_static_cast_downcast

Conversation

@castler

@castler castler commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Fixes cppcoreguidelines-pro-type-static-cast-downcast in BidirectionalTransport::HandleResponse by using dynamic_cast with a null check (same pattern as QemuHypervisorTransport) instead of a suppression. The null check replaces the previous GetType() comparison.

Verified: --config=ci build and all sample transport tests pass.

@castler castler changed the title fix(clang-tidy): justify static_cast downcast in HandleResponse fix(clang-tidy): use dynamic_cast for downcast in HandleResponse Oct 7, 2026
@castler
castler force-pushed the fix_static_cast_downcast branch from 0003e08 to 85707c4 Compare October 7, 2026 09:02
@castler
castler marked this pull request as ready for review October 7, 2026 09:07
@castler
castler enabled auto-merge October 7, 2026 09:07
@castler
castler added this pull request to the merge queue Oct 7, 2026
Replace the static_cast downcast with dynamic_cast plus a null check,
matching how QemuHypervisorTransport handles the same message types. The
null check also replaces the former GetType() comparison.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merged via the queue into eclipse-score:main with commit a1fd72a Oct 7, 2026
18 checks passed
@castler
castler deleted the fix_static_cast_downcast branch October 7, 2026 10:07
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.

2 participants