Debian Codegraph @

clang/test/C/C23/n2838.c

raw
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 (295'147'905'179'352'825'841 elements)}} */
8 char buffer3[0xFFFF'FFFF'FFFF'FFFFwb]; /* expected-error {{array is too large (18'446'744'073'709'551'615 elements)}} */
9 char buffer2[0x7FFF'FFFF'FFFF'FFFFwb]; /* expected-error {{array is too large (9'223'372'036'854'775'807 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__);