Commit 1e6ed71
committed
Add STATIC_ASSERT_EXPR
This new type of a STATIC_ASSERT is used where an expression can go;
hence potentially in macro expansions. Since it is compile-time, it
can't be used on arguments that are expressions with side effects, so
can safely be used in macros.
It has limitations however, only reaching full parity when gcc brace
groups are enabled, turning into an ASSUME which is a no-op in the worst
case.
However, most code will get compiled on a platform with gcc brace
groups, and will pass or fail at compile time; so the chances of
something bad actually getting into the field are minimal.1 parent d112e35 commit 1e6ed71
1 file changed
+21
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4252 | 4252 | | |
4253 | 4253 | | |
4254 | 4254 | | |
| 4255 | + | |
4255 | 4256 | | |
4256 | 4257 | | |
4257 | 4258 | | |
| |||
4269 | 4270 | | |
4270 | 4271 | | |
4271 | 4272 | | |
4272 | | - | |
| 4273 | + | |
| 4274 | + | |
| 4275 | + | |
| 4276 | + | |
| 4277 | + | |
| 4278 | + | |
| 4279 | + | |
| 4280 | + | |
| 4281 | + | |
| 4282 | + | |
| 4283 | + | |
| 4284 | + | |
4273 | 4285 | | |
| 4286 | + | |
4274 | 4287 | | |
| 4288 | + | |
4275 | 4289 | | |
4276 | 4290 | | |
4277 | 4291 | | |
| |||
4335 | 4349 | | |
4336 | 4350 | | |
4337 | 4351 | | |
| 4352 | + | |
| 4353 | + | |
| 4354 | + | |
| 4355 | + | |
| 4356 | + | |
| 4357 | + | |
4338 | 4358 | | |
4339 | 4359 | | |
4340 | 4360 | | |
| |||
0 commit comments