public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110340] New: [C++26] P2621R2 - Remove undefined behavior from lexing
@ 2023-06-21 16:03 mpolacek at gcc dot gnu.org
  2023-06-21 21:20 ` [Bug c++/110340] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-06-21 16:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110340
           Summary: [C++26] P2621R2 - Remove undefined behavior from
                    lexing
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

See <https://wg21.link/P2621R2>.

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

* [Bug c++/110340] [C++26] P2621R2 - Remove undefined behavior from lexing
  2023-06-21 16:03 [Bug c++/110340] New: [C++26] P2621R2 - Remove undefined behavior from lexing mpolacek at gcc dot gnu.org
@ 2023-06-21 21:20 ` pinskia at gcc dot gnu.org
  2023-06-23 20:01 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-21 21:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Full testcase for the first 2 issues raised in the paper:
```
int \\
u\
0\
3\
9\
1 = 0;

#define CONCAT(x,y) x##y

int CONCAT(\,u0393)=0;
```

Testcase for the last one:
```
const char * foo=" // { dg-error "" }
```

as far as I understand from the paper, instead of the above being undefined at
compiletime, the first testcase becomes valid and the last one becomes invalid.
And right now GCC acts according to the paper already so there is not anything
to be done. Maybe add a testcase for these if there is not already one is
enough ...

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

* [Bug c++/110340] [C++26] P2621R2 - Remove undefined behavior from lexing
  2023-06-21 16:03 [Bug c++/110340] New: [C++26] P2621R2 - Remove undefined behavior from lexing mpolacek at gcc dot gnu.org
  2023-06-21 21:20 ` [Bug c++/110340] " pinskia at gcc dot gnu.org
@ 2023-06-23 20:01 ` jason at gcc dot gnu.org
  2023-06-23 20:30 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2023-06-23 20:01 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Full testcase for the first 2 issues raised in the paper:

Thanks, want to add these to the testsuite and close the PR?

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

* [Bug c++/110340] [C++26] P2621R2 - Remove undefined behavior from lexing
  2023-06-21 16:03 [Bug c++/110340] New: [C++26] P2621R2 - Remove undefined behavior from lexing mpolacek at gcc dot gnu.org
  2023-06-21 21:20 ` [Bug c++/110340] " pinskia at gcc dot gnu.org
  2023-06-23 20:01 ` jason at gcc dot gnu.org
@ 2023-06-23 20:30 ` mpolacek at gcc dot gnu.org
  2023-07-18 17:33 ` cvs-commit at gcc dot gnu.org
  2023-07-18 17:34 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-06-23 20:30 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-06-23
             Status|UNCONFIRMED                 |ASSIGNED

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

* [Bug c++/110340] [C++26] P2621R2 - Remove undefined behavior from lexing
  2023-06-21 16:03 [Bug c++/110340] New: [C++26] P2621R2 - Remove undefined behavior from lexing mpolacek at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-06-23 20:30 ` mpolacek at gcc dot gnu.org
@ 2023-07-18 17:33 ` cvs-commit at gcc dot gnu.org
  2023-07-18 17:34 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-07-18 17:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:fca089e8a47314a40ad93527ba9f9d0d374b3afb

commit r14-2626-gfca089e8a47314a40ad93527ba9f9d0d374b3afb
Author: Marek Polacek <polacek@redhat.com>
Date:   Tue Jul 18 13:26:39 2023 -0400

    c++: Add tests for P2621, no UB in lexer [PR110340]

    C++26 P2621 removes UB in the lexer and either makes the construct valid
    or ill-formed.  We're already handling this correctly so this patch only
    adds tests.

            PR c++/110340

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp/string-4.C: New test.
            * g++.dg/cpp/ucn-2.C: New test.

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

* [Bug c++/110340] [C++26] P2621R2 - Remove undefined behavior from lexing
  2023-06-21 16:03 [Bug c++/110340] New: [C++26] P2621R2 - Remove undefined behavior from lexing mpolacek at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-07-18 17:33 ` cvs-commit at gcc dot gnu.org
@ 2023-07-18 17:34 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-07-18 17:34 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Done.

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

end of thread, other threads:[~2023-07-18 17:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21 16:03 [Bug c++/110340] New: [C++26] P2621R2 - Remove undefined behavior from lexing mpolacek at gcc dot gnu.org
2023-06-21 21:20 ` [Bug c++/110340] " pinskia at gcc dot gnu.org
2023-06-23 20:01 ` jason at gcc dot gnu.org
2023-06-23 20:30 ` mpolacek at gcc dot gnu.org
2023-07-18 17:33 ` cvs-commit at gcc dot gnu.org
2023-07-18 17:34 ` mpolacek 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).