Skip to content
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

🎨 Improve STATIC_ASSERT #167

Merged
merged 1 commit into from
Oct 30, 2024
Merged

Conversation

elbeno
Copy link
Contributor

@elbeno elbeno commented Oct 30, 2024

Problem:

  • Writing STATIC_ASSERT(cond, str) means that str has to be formatted either as a separate variable or inline in the call.

Solution:

  • Allow STATIC_ASSERT(cond, fmt_str, args...) where the string is formatted automatically.

Notes:

Problem:
- Writing `STATIC_ASSERT(cond, str)` means that `str` has to be formatted either
  as a separate variable or inline in the call.

Solution:
- Allow `STATIC_ASSERT(cond, fmt_str, args...)` where the string is formatted
  automatically.

Notes:
- Each argument must still be wrapped in `CX_VALUE`. Because there is no
  generic equivalent of `transform` for `__VA_ARGS__`.
- A bug in clang (for which a workaround is in place) was discovered:
  llvm/llvm-project#114234
- `CX_VALUE` has been made more workable with GCC. GCC did not allow the
  `struct` definition inside the macro.
@elbeno elbeno merged commit 73569fe into intel:main Oct 30, 2024
32 checks passed
@elbeno elbeno deleted the extended-static-assert branch October 30, 2024 14:30
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