https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113914
Bug ID: 113914
Summary: GCC accepts user-defined integer-literal that does not
fit in any type
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: janschultke at googlemail dot com
Target Milestone: ---
> int operator""_zero(unsigned long long);
> int x = 0x1000000000000000000000000000000000000000000000000000000000000_zero;
This code is ill-formed but GCC does not emit a diagnostic
(https://godbolt.org/z/r9KrGGafY). Note that as per
https://eel.is/c++draft/lex.ext#3, this is treated like a call:
> operator""_zero(0x1000...000ULL)
However, the ULL-suffixed integer-literal would be ill-formed. Clang reject
this.