Skip to content

Conversation

mike919192
Copy link
Contributor

Maybe due to merge error, the etl::array [] operator overloads have incorrect ETL_NOEXCEPT_EXPR. This corrects the expressions to use the correct ETL options.

@coderabbitai
Copy link

coderabbitai bot commented Oct 17, 2025

Walkthrough

The pull request modifies the noexcept specifications for the array subscript operator in include/etl/array.h. Both the const and non-const overloads of operator[] have their exception specifications updated. The condition changes from ETL_DEBUG_NOT_USING_EXCEPTIONS to ETL_NOT_USING_EXCEPTIONS || ETL_NOT_CHECKING_INDEX_OPERATOR. This affects when the compiler treats these operations as non-throwing at compile-time, though the runtime exception handling behaviour remains unchanged.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Bugfix: array noexcept expr" is concise and directly related to the main change in the pull request. It clearly identifies the file being modified (array) and the specific aspect being fixed (noexcept expressions), which matches the changes where the noexcept specifications of both const and non-const operator[] overloads were updated from using ETL_DEBUG_NOT_USING_EXCEPTIONS to ETL_NOT_USING_EXCEPTIONS || ETL_NOT_CHECKING_INDEX_OPERATOR. The title is specific enough that a teammate scanning the repository history would understand the primary change without confusion.
Description Check ✅ Passed The pull request description is clearly related to the changeset. It explicitly mentions "etl::array [] operator overloads" and "incorrect ETL_NOEXCEPT_EXPR", which directly correspond to the changes made to the noexcept specifications in the array class. The description provides context by noting a possible merge error and explains that the fix corrects the expressions to use the proper ETL options, which aligns with the actual modifications shown in the summary.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
include/etl/array.h (1)

708-722: Add ETL_NOEXCEPT to operator[] overloads in the zero-sized array specialisation for consistency.

The operator[] overloads at lines 708 and 719 lack noexcept specifications, whilst the main template uses ETL_NOEXCEPT_EXPR(...) on the same methods. The entire zero-sized specialisation systematically omits noexcept specifications despite all methods (including at(), front(), back()) performing operations that cannot throw. Since these operators call *data() without bounds checking, adding ETL_NOEXCEPT would align with the main template's approach and improve clarity.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a025d0c and 7eff215.

📒 Files selected for processing (1)
  • include/etl/array.h (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
include/etl/*.h

⚙️ CodeRabbit configuration file

include/etl/*.h: Review the C++ code in these directories. The code must not use
STL containers but must instead rely on Embedded Template Library
(ETL) for data structures and algorithms.

When answering questions, provide accurate and concise information based on the ETL documentation and codebase. If you don't know the answer, just say "I don't know". Do not make up answers.
When providing code examples, ensure they are relevant to the ETL and follow its conventions.
Always be polite and professional in your responses.

Header files should start with the ETL's standard MIT comment block.

Header files should have include guards in the format '#ifndef ETL_>INCLUDED #define ETL_INCLUDED #endif'

Headers should be organized in the following order

  • The first header include should be '#include "platform.h"'
  • Headers from the ETL
  • Headers from the path 'private/**'
  • C++ standard library headers
  • C standard library headers

Pay extra attention to the following

  • Buffer overflows
  • Memory leaks
  • Undefined behavior

Check that the following conventions are used

  • Variable names should be in snake_case
  • Macro constants should be ALL_CAPS_WITH_UNDERSCORES
  • Macro constants should be prefixed with 'ETL_'
  • Function, class, and type names should be snake_case
  • enum members should be Caps_Snake_Case

Please keep your outputs short and to the point, unless otherwise asked

  • Keep your responses short, describe small issues in a few sentences
  • Don't output tips, analysis chains or anything else with a collapsible view
  • Don't output comment summaries or fix prompts for AIs
  • If the highlighted issue is complex, don't suggest a solution
  • Don't use emojis

Files:

  • include/etl/array.h
🧬 Code graph analysis (1)
include/etl/array.h (1)
include/etl/span.h (2)
  • ETL_NOEXCEPT_EXPR (534-548)
  • ETL_NOEXCEPT_EXPR (1010-1017)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: GCC C++11 Linux - No STL (ubuntu-22.04)
  • GitHub Check: GCC C++11 Linux - STL (ubuntu-22.04)
  • GitHub Check: Clang C++23 Linux - No STL - Force C++03 (ubuntu-22.04)
  • GitHub Check: Clang C++23 Linux - No STL (ubuntu-22.04)
  • GitHub Check: Clang C++23 Linux - STL - Force C++03 (ubuntu-22.04)
  • GitHub Check: Clang C++11 Linux - No STL (ubuntu-22.04)
  • GitHub Check: Clang C++11 Linux - STL (ubuntu-22.04)
  • GitHub Check: Clang C++14 Linux - STL (ubuntu-22.04)
  • GitHub Check: GCC C++23 Linux - No STL - Force C++03 (ubuntu-22.04)
  • GitHub Check: Clang C++17 Linux - No STL (ubuntu-22.04)
  • GitHub Check: Clang C++17 Linux - STL (ubuntu-22.04)
  • GitHub Check: Windows - STL - Force C++03
  • GitHub Check: Clang C++14 Linux - No STL (ubuntu-22.04)
  • GitHub Check: GCC C++23 Linux - STL - Force C++03 (ubuntu-22.04)
  • GitHub Check: Windows - No STL
  • GitHub Check: Windows - No STL - Force C++03
  • GitHub Check: Windows - STL
  • GitHub Check: GCC C++23 Linux - STL (ubuntu-22.04)
  • GitHub Check: GCC C++23 Linux - No STL (ubuntu-22.04)
  • GitHub Check: GCC C++14 Linux - STL (ubuntu-22.04)
🔇 Additional comments (2)
include/etl/array.h (2)

146-151: LGTM! Correct noexcept specification for operator[].

The noexcept condition now properly aligns with the ETL_ASSERT_CHECK_INDEX_OPERATOR macro used in the function body. The operator is correctly marked noexcept when either exceptions are disabled or index operator checking is disabled.


159-169: LGTM! Correct noexcept specification for const operator[].

The noexcept condition properly matches both the ETL_ASSERT_CHECK_INDEX_OPERATOR assertion and the conditional exception throw in the C++11/C++14 path. The specification is consistent with the non-const overload.

@jwellbelove jwellbelove changed the base branch from master to development October 19, 2025 16:09
@jwellbelove jwellbelove merged commit bb24ea2 into ETLCPP:development Oct 19, 2025
83 checks passed
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