Skip to content

gmacros: Use _Static_assert only for non-expr static assert

Nirbheek Chauhan requested to merge nirbheek/static-assert-try-2 into master

We can't actually use it inside an expression, so keep the old macro for that. Also add a test so that this doesn't break the next time we change it.

See: !955 (comment 542646)

@mcatanzaro suggested a lambda expr for C++ in !955 (comment 543175), but I didn't like that because it's not negligible-compile-time cost unlike static_assert since it has to instantiate a new type at each location where it's called.

Edited by Nirbheek Chauhan

Merge request reports