[PATCH] assert: Support assert as variadic macro for C++26 [PR27276]

Florian Weimer fweimer@redhat.com
Thu Feb 5 15:36:10 GMT 2026


* Tomasz Kamiński:

> +#  if __ASSERT_VARIADIC
> +#    define assert(...)							\
> +     ((__VA_ARGS__)							\
> +      ? (void)(1 ? 1 : bool(__VA_ARGS__))				\
> +      : __assert_fail (#__VA_ARGS__, __ASSERT_FILE, __ASSERT_LINE,	\
> +                       __ASSERT_FUNCTION))

Doesn't this evaluate __VA_ARGS__ multiple times?

Thanks,
Florian



More information about the Libc-alpha mailing list