diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-12-01 10:21:20 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2021-12-01 10:21:20 +0100 |
commit | c264208e161830a5642ee3125871c23110508462 (patch) | |
tree | d9ceae0bad702467a9c2e5042ddbe7a7d7066040 /gcc | |
parent | 35f2c098c81118020b1d288cd739108c8747a520 (diff) | |
download | gcc-c264208e161830a5642ee3125871c23110508462.zip gcc-c264208e161830a5642ee3125871c23110508462.tar.gz gcc-c264208e161830a5642ee3125871c23110508462.tar.bz2 |
libcpp: Enable P1949R7 for C++98 too [PR100977]
On Mon, Nov 29, 2021 at 05:53:58PM -0500, Jason Merrill wrote:
> I'm inclined to go ahead and change C++98 as well; I doubt anyone is relying
> on the particular C++98 extended character set rules, and we already accept
> the union of the different sets when not pedantic.
Ok, here is an incremental patch to do that also for -std={c,gnu}++98.
2021-12-01 Jakub Jelinek <jakub@redhat.com>
PR c++/100977
* init.c (struct lang_flags): Remove cxx23_identifiers.
(lang_defaults): Remove cxx23_identifiers initializers.
(cpp_set_lang): Don't copy cxx23_identifiers.
* include/cpplib.h (struct cpp_options): Adjust comment about
c11_identifiers. Remove cxx23_identifiers field.
* lex.c (warn_about_normalization): Use cplusplus instead of
cxx23_identifiers.
* charset.c (ucn_valid_in_identifier): Likewise.
* g++.dg/cpp/ucnid-1.C: Adjust expected diagnostics.
* g++.dg/cpp/ucnid-1-utf8.C: Likewise.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp/ucnid-1-utf8.C | 16 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp/ucnid-1.C | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/gcc/testsuite/g++.dg/cpp/ucnid-1-utf8.C b/gcc/testsuite/g++.dg/cpp/ucnid-1-utf8.C index 839b188..01172c8 100644 --- a/gcc/testsuite/g++.dg/cpp/ucnid-1-utf8.C +++ b/gcc/testsuite/g++.dg/cpp/ucnid-1-utf8.C @@ -1,17 +1,17 @@ /* { dg-do preprocess } */ /* { dg-options "-std=gnu++98 -pedantic" } */ -ª /* { dg-error "not valid in an identifier" } */ +ª « /* { dg-error "not valid in an identifier" } */ ¶ /* { dg-error "not valid in an identifier" } */ -º /* { dg-error "not valid in an identifier" } */ +º À Ö -΄ +΄ /* { dg-error "not valid in an identifier" } */ -٩ /* { dg-error "not valid in an identifier" } */ -A٩ /* { dg-error "not valid in an identifier" } */ -0º /* { dg-error "not valid in an identifier" } */ -0٩ /* { dg-error "not valid in an identifier" } */ -๙ +٩ /* { dg-error "not valid at the start of an identifier" } */ +A٩ +0º +0٩ +๙ /* { dg-error "not valid at the start of an identifier" } */ A๙ diff --git a/gcc/testsuite/g++.dg/cpp/ucnid-1.C b/gcc/testsuite/g++.dg/cpp/ucnid-1.C index 65c8995..b0a64e3 100644 --- a/gcc/testsuite/g++.dg/cpp/ucnid-1.C +++ b/gcc/testsuite/g++.dg/cpp/ucnid-1.C @@ -1,17 +1,17 @@ /* { dg-do preprocess } */ /* { dg-options "-std=gnu++98 -pedantic" } */ -\u00AA /* { dg-error "not valid in an identifier" } */ +\u00AA \u00AB /* { dg-error "not valid in an identifier" } */ \u00B6 /* { dg-error "not valid in an identifier" } */ -\u00BA /* { dg-error "not valid in an identifier" } */ +\u00BA \u00C0 \u00D6 -\u0384 +\u0384 /* { dg-error "not valid in an identifier" } */ -\u0669 /* { dg-error "not valid in an identifier" } */ -A\u0669 /* { dg-error "not valid in an identifier" } */ -0\u00BA /* { dg-error "not valid in an identifier" } */ -0\u0669 /* { dg-error "not valid in an identifier" } */ -\u0E59 +\u0669 /* { dg-error "not valid at the start of an identifier" } */ +A\u0669 +0\u00BA +0\u0669 +\u0E59 /* { dg-error "not valid at the start of an identifier" } */ A\u0E59 |