-
-
Notifications
You must be signed in to change notification settings - Fork 470
Added conditional support of noexcept to fix IAR support #1195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -331,8 +331,13 @@ SOFTWARE. | |
#define ETL_ENUM_CLASS(name) enum class name | ||
#define ETL_ENUM_CLASS_TYPE(name, type) enum class name : type | ||
#define ETL_LVALUE_REF_QUALIFIER & | ||
#define ETL_NOEXCEPT noexcept | ||
#define ETL_NOEXCEPT_EXPR(...) noexcept(__VA_ARGS__) | ||
#if ETL_USING_EXCEPTIONS | ||
#define ETL_NOEXCEPT noexcept | ||
#define ETL_NOEXCEPT_EXPR(...) noexcept(__VA_ARGS__) | ||
#else | ||
#define ETL_NOEXCEPT | ||
#define ETL_NOEXCEPT_EXPR(...) | ||
#endif | ||
Comment on lines
+334
to
+340
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major 🧩 Analysis chainConditional noexcept correctly implements IAR workaround. The conditional definition properly addresses IAR 8.x's rejection of the Verify that this change doesn't adversely affect other supported compilers. Run the following script to check for any direct usage of 🏁 Script executed: #!/bin/bash
# Description: Find any direct usage of noexcept keyword that might need similar treatment
# Search for noexcept keyword usage outside of macro definitions
rg -n --type=cpp --type=c -g '!platform.h' '\bnoexcept\b' -C2 Length of output: 148 🏁 Script executed: #!/bin/bash
# Search for direct usages of noexcept outside the macro definitions,
# excluding include/etl/platform.h
rg -n --type=c --type=cpp '\bnoexcept\b' -C2 --glob '!include/etl/platform.h' Length of output: 148 🏁 Script executed: #!/bin/bash
# Search for direct usages of noexcept outside platform.h without type filters
rg -n 'noexcept\b' -C2 --glob '!include/etl/platform.h' Length of output: 148 🏁 Script executed: #!/bin/bash
# Broad search for any direct usage of noexcept in the codebase
rg -n 'noexcept\b' -C2 Length of output: 41748 Use ETL_NOEXCEPT instead of raw noexcept 🤖 Prompt for AI Agents
|
||
#else | ||
#define ETL_CONSTEXPR | ||
#define ETL_CONSTEXPR11 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jwellbelove, if you don't like using this flag, I can also recommend using the feature test macro in the C++ standard:
#if defined(__cpp_exceptions)