public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/113914] New: GCC accepts user-defined integer-literal that does not fit in any type
@ 2024-02-13 23:25 janschultke at googlemail dot com
  2024-02-13 23:43 ` [Bug c++/113914] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: janschultke at googlemail dot com @ 2024-02-13 23:25 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/113914] GCC accepts user-defined integer-literal that does not fit in any type
  2024-02-13 23:25 [Bug c++/113914] New: GCC accepts user-defined integer-literal that does not fit in any type janschultke at googlemail dot com
@ 2024-02-13 23:43 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-13 23:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113914

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
      Known to fail|                            |4.7.1
   Last reconfirmed|                            |2024-02-13
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. Looks not to be a regression either.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-13 23:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-13 23:25 [Bug c++/113914] New: GCC accepts user-defined integer-literal that does not fit in any type janschultke at googlemail dot com
2024-02-13 23:43 ` [Bug c++/113914] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).