| 1 |
// RUN: %clang_cc1 -triple x86_64 -verify -std=c2x %s |
| 2 |
|
| 3 |
/* WG14 N2838: yes |
| 4 |
* Types and sizes |
| 5 |
*/ |
| 6 |
|
| 7 |
char buffer4[0xFFFF'FFFF'FFFF'FFFF'1wb]; /* expected-error {{array is too large (295147905179352825841 elements)}} */ |
| 8 |
char buffer3[0xFFFF'FFFF'FFFF'FFFFwb]; /* expected-error {{array is too large (18446744073709551615 elements)}} */ |
| 9 |
char buffer2[0x7FFF'FFFF'FFFF'FFFFwb]; /* expected-error {{array is too large (9223372036854775807 elements)}} */ |
| 10 |
char buffer1[0x1FFF'FFFF'FFFF'FFFFwb]; /* array is juuuuuust right */ |
| 11 |
|
| 12 |
/* The largest object we can create is still smaller than SIZE_MAX. */ |
| 13 |
static_assert(0x1FFF'FFFF'FFFF'FFFFwb <= __SIZE_MAX__); |