public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110343] New: [C++26] P2558R2 - Add @, $, and ` to the basic character set
@ 2023-06-21 16:13 mpolacek at gcc dot gnu.org
  2023-08-23 12:45 ` [Bug c++/110343] " jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-06-21 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110343
           Summary: [C++26] P2558R2 - Add @, $, and ` to the basic
                    character set
           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/P2558R2>.

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

* [Bug c++/110343] [C++26] P2558R2 - Add @, $, and ` to the basic character set
  2023-06-21 16:13 [Bug c++/110343] New: [C++26] P2558R2 - Add @, $, and ` to the basic character set mpolacek at gcc dot gnu.org
@ 2023-08-23 12:45 ` jakub at gcc dot gnu.org
  2024-01-09 18:35 ` emsr at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-08-23 12:45 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
clang claims to implement this but that doesn't seem to be the case, I think
e.g.
const char *p = R"abc`@$(foobar)abc`@$";
should be accepted for -std=c++2c.
I'm lost at what we need to do for
This is currently rejected by GCC ‘error: universal character is not valid in
an identifier’, although this seems to be a bug, and the code is accepted by
clang and msvc.
in the paper (3.1).

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

* [Bug c++/110343] [C++26] P2558R2 - Add @, $, and ` to the basic character set
  2023-06-21 16:13 [Bug c++/110343] New: [C++26] P2558R2 - Add @, $, and ` to the basic character set mpolacek at gcc dot gnu.org
  2023-08-23 12:45 ` [Bug c++/110343] " jakub at gcc dot gnu.org
@ 2024-01-09 18:35 ` emsr at gcc dot gnu.org
  2024-01-09 18:39 ` emsr at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: emsr at gcc dot gnu.org @ 2024-01-09 18:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Ed Smith-Rowland <emsr at gcc dot gnu.org> ---
The example in the paper:
----------------------------------------------------------
/*
gcc -E charset.c > charhelp.c
gcc -o charhelp charhelp.c
*/

#include <stdio.h>

#define STR(x) #x

int main()
{
  printf("%s", STR(\u0060)); // U+0060 is ` GRAVE ACCENT
  printf("%s", "\u0060"); // U+0060 is ` GRAVE ACCENT
}
----------------------------------------------------------
Does give an error, but when I preprocess the file with -E the result
compiles just fine with either C or C++.

Preprocessor bug?

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

* [Bug c++/110343] [C++26] P2558R2 - Add @, $, and ` to the basic character set
  2023-06-21 16:13 [Bug c++/110343] New: [C++26] P2558R2 - Add @, $, and ` to the basic character set mpolacek at gcc dot gnu.org
  2023-08-23 12:45 ` [Bug c++/110343] " jakub at gcc dot gnu.org
  2024-01-09 18:35 ` emsr at gcc dot gnu.org
@ 2024-01-09 18:39 ` emsr at gcc dot gnu.org
  2024-01-09 18:44 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: emsr at gcc dot gnu.org @ 2024-01-09 18:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Ed Smith-Rowland <emsr at gcc dot gnu.org> ---
Created attachment 57018
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57018&action=edit
Get the raw string literal to compile.

I just added the new characters to lex_raw_string and got

const char *p = R"abc`@$(foobar)abc`@$";

to go.

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

* [Bug c++/110343] [C++26] P2558R2 - Add @, $, and ` to the basic character set
  2023-06-21 16:13 [Bug c++/110343] New: [C++26] P2558R2 - Add @, $, and ` to the basic character set mpolacek at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-01-09 18:39 ` emsr at gcc dot gnu.org
@ 2024-01-09 18:44 ` jakub at gcc dot gnu.org
  2024-01-09 19:42 ` emsr at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-09 18:44 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Ed Smith-Rowland from comment #3)
> Created attachment 57018 [details]
> Get the raw string literal to compile.
> 
> I just added the new characters to lex_raw_string and got
> 
> const char *p = R"abc`@$(foobar)abc`@$";
> 
> to go.

Shouldn't those be added conditionally on whether it is -std=c++26 compilation
or not?

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

* [Bug c++/110343] [C++26] P2558R2 - Add @, $, and ` to the basic character set
  2023-06-21 16:13 [Bug c++/110343] New: [C++26] P2558R2 - Add @, $, and ` to the basic character set mpolacek at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-01-09 18:44 ` jakub at gcc dot gnu.org
@ 2024-01-09 19:42 ` emsr at gcc dot gnu.org
  2024-01-09 22:01 ` emsr at gcc dot gnu.org
  2024-05-02  8:28 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: emsr at gcc dot gnu.org @ 2024-01-09 19:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Ed Smith-Rowland <emsr at gcc dot gnu.org> ---
Probably should. I'll see how to do that.
I might have to set up the lang flag and all that unless someone beats me to
it.

I was going to say that the error on the stringification is possibly correct.
The paper says usage in things _other_ than literals is illegal.

Plus, over on gcc I think they have the equivalent thing implemented and I
assume they would know.

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

* [Bug c++/110343] [C++26] P2558R2 - Add @, $, and ` to the basic character set
  2023-06-21 16:13 [Bug c++/110343] New: [C++26] P2558R2 - Add @, $, and ` to the basic character set mpolacek at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-01-09 19:42 ` emsr at gcc dot gnu.org
@ 2024-01-09 22:01 ` emsr at gcc dot gnu.org
  2024-05-02  8:28 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: emsr at gcc dot gnu.org @ 2024-01-09 22:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Ed Smith-Rowland <emsr at gcc dot gnu.org> ---
Created attachment 57019
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57019&action=edit
Add a flag to only allow new chars in c++26.

Here s a patch that adds and checks a flag in libcpp and also adds a test.

If you have a better idea for the flag name let me know.

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

* [Bug c++/110343] [C++26] P2558R2 - Add @, $, and ` to the basic character set
  2023-06-21 16:13 [Bug c++/110343] New: [C++26] P2558R2 - Add @, $, and ` to the basic character set mpolacek at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-01-09 22:01 ` emsr at gcc dot gnu.org
@ 2024-05-02  8:28 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-05-02  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Note, GCC 15 stage1 is open, so feel free to post your patch.

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

end of thread, other threads:[~2024-05-02  8:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21 16:13 [Bug c++/110343] New: [C++26] P2558R2 - Add @, $, and ` to the basic character set mpolacek at gcc dot gnu.org
2023-08-23 12:45 ` [Bug c++/110343] " jakub at gcc dot gnu.org
2024-01-09 18:35 ` emsr at gcc dot gnu.org
2024-01-09 18:39 ` emsr at gcc dot gnu.org
2024-01-09 18:44 ` jakub at gcc dot gnu.org
2024-01-09 19:42 ` emsr at gcc dot gnu.org
2024-01-09 22:01 ` emsr at gcc dot gnu.org
2024-05-02  8:28 ` jakub 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).