Declare defaulted move ops noexcept (SonarQube BLOCKER cpp:S5018)#1227
Declare defaulted move ops noexcept (SonarQube BLOCKER cpp:S5018)#1227rgsl888prabhu wants to merge 2 commits into
Conversation
Add noexcept to seven `= default` move ctor / move assign declarations flagged by SonarQube rule cpp:S5018. All affected classes already move trivially-noexcept members, so the specifier is a no-op at runtime and just satisfies the rule. Affected types: - optimization_problem_t (move ctor + move assign) - pdlp_warm_start_data_t (move assign) - deterministic_diving_worker_t (move ctor + move assign) - mip_node_t (move ctor + move assign) Clears 7 of 8 BLOCKER findings on `main`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR standardizes move special member declarations by adding explicit ChangesMove Special Members Exception Specification
🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
clang-format adjusts column alignment of the surrounding deleted-copy declarations to match the new noexcept move declarations. Whitespace only.
Sorry which one is it? Does it change the behavior of STL containers when these types or stored or is it a no-op? |
|
Sorry, that was contradictory wording on my part. Quick clarification: In general, For these four types specifically, I checked the codebase:
So in practice on the current code, the change really is a runtime no-op; it only satisfies the lint rule and would start mattering if a future change put one of these in a container by value. I've also dropped the misleading paragraph from the PR description. |
SonarQube rule
cpp:S5018flags= defaulted move constructors and move-assignment operators that arent declarednoexcept. This PR addsnoexceptto the seven flagged sites onmain, clearing 7 of 8 BLOCKER findings.All affected classes already move trivially-noexcept members (
std::vector,std::unique_ptr,rmm::device_uvector, raw pointers, scalars), so the specifier compiles cleanly. None of these four types are currently stored by value in an STL container (mip_node_tis always behindunique_ptror raw pointer; the other three dont appear in containers), so on the current code this is a runtime no-op — it just satisfies the lint rule.