Skip to content

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