From patchwork Fri Oct 14 23:10:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 2890 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp414101wrs; Fri, 14 Oct 2022 16:10:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7DxqBdYH3MtmwEjaElnc7wc7On9Eg6ag3j+IFjVJmjUT8vAmwZ1nrQ/Uo+IQ1MjOkqreml X-Received: by 2002:aa7:cc8a:0:b0:45b:f851:2943 with SMTP id p10-20020aa7cc8a000000b0045bf8512943mr122173edt.103.1665789050028; Fri, 14 Oct 2022 16:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665789050; cv=none; d=google.com; s=arc-20160816; b=OM2Wx2uZsXt/1RwEwXxLeBB0hioSxuMgxOZ3XSwyC5EPVw9rpqsYpCdZ5e6C07MdJb BMB5TZplwAEhoZSnRFeIcngsZJvSQ/dbvI3TRTiQvBSewOOvcBWNgQG23P8T/GD3ktez kYUyJj7zA6/Xm5HqPDGc59Ln840omhtpb3NZqc8A0xsA5o5i6gYMjWiDWNA+wqPGs9hB XU71WL6b0tJ8LuM+1hO+vBCkumw3DqNygQ9NOvB/2CFpTbFCp34Oxu0lgeDjuR/c5huf McUf9v/m5skbev9AbF/QgIHxRUrd8UaPnBvff5l4TCMAnjxRFwqH0/hFpiLuRn3deL72 KpMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:message-id:subject:to:from:date :ironport-sdr:dmarc-filter:delivered-to; bh=LBaD6nmKx9Lm7r+d6bLJi3bRJELGSMcx90JlycQv6jM=; b=YwRMerNzP4Sip5RH7ECIXBDZ745qpELLZWk7W4fQSQ2wWTf83sHEiaR7BRsFIuXVim ECwiMWfA+h3dXqz7P3M9Tmqz+WCH7KjKWTSTk8oVjAHVv1ZwvtqVQiiVTZ3TYf4jLvto hwGrdYh4teRs8sE/IOnDakMtUwc1+itwd8soiG+gcHTk6q7/G9/TkNNlz43icg8krLLZ 8IPOfDjyojsoaLLVnTRQ8BycTePEOBZEl9LWeNAvrpQi17RaQoYkffs4OyLAwRH+91vX PlaCXKDacfGt0zzGLGNnTyqoZpsZuYPeGzdXCIcH9KengQ1gyB5zcadJMM8mooAjfolY h/tA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q17-20020a170906361100b00787d08d5ff4si3166468ejb.695.2022.10.14.16.10.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 16:10:50 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A32E385740E for ; Fri, 14 Oct 2022 23:10:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 813993858C52 for ; Fri, 14 Oct 2022 23:10:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 813993858C52 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.95,185,1661846400"; d="scan'208";a="87562257" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 14 Oct 2022 15:10:16 -0800 IronPort-SDR: eJZQ39y7K6QcP3Ip7QAlPyApF4fU24BlzGWSlzgVtoaldAB8ievco136nzoO2YZ/WI9gNhzxCu CBDY/ScHYq+S248bIvztL/+YTlTMjsvm/M9hjUCIvUrDgC6Aedr0G9qHFttTusljAUOBSwLuyP A+ag5d7NIBAQNKUuKUTZSaQDZv4g6K5piL4cdZ/o6cdAwaTlN4J6LWyjZJuKilUwx9ZWPWex9k tVl7L0GXxB637h1ONEhDXf/ZcBX1uNj9pa38ZMHG5FfoMDtYBrzvEu5o+SsUQV2zPfvby6KLgH b0c= Date: Fri, 14 Oct 2022 23:10:11 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Subject: [committed] preprocessor: C2x identifier rules Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-09.mgc.mentorg.com (139.181.222.9) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3114.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SCC_10_SHORT_WORD_LINES, SCC_20_SHORT_WORD_LINES, SCC_35_SHORT_WORD_LINES, SCC_5_SHORT_WORD_LINES, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746706419168755621?= X-GMAIL-MSGID: =?utf-8?q?1746706419168755621?= C2x has, like C++, adopted rules for identifiers based directly on an unversioned normative reference to Unicode. Make libcpp follow those rules for c2x / gnu2x standards (this involves bringing back a flag separate from the C++ one for whether to use these identifier rules, but this time enabled for all C++ language versions since that was the conclusion adopted for C++ identifier handling). There is one change here that affects C++. I believe the new normative requirement for NFC only applies to identifiers, not to the use of identifier-continue characters in pp-numbers, where there is no such requirement and so the diagnostic ought to be a warning not a pedwarn in pp-numbers, and that this is the case for both C and C++. Bootstrapped with no regressions for x86_64-pc-linux-gnu. libcpp/ * charset.cc (ucn_valid_in_identifier): Check xid_identifiers not cplusplus to determine whether to use CXX23 and NXX23 flags. * include/cpplib.h (struct cpp_options): Add xid_identifiers. * init.cc (struct lang_flags, lang_defaults): Add xid_identifiers. (cpp_set_lang): Set xid_identifiers. * lex.cc (warn_about_normalization): Add parameter identifier. Only pedwarn about non-NFC for identifiers, not pp-numbers. (_cpp_lex_direct): Update calls to warn_about_normalization. gcc/testsuite/ * gcc.dg/cpp/c2x-ucnid-1-utf8.c, gcc.dg/cpp/c2x-ucnid-1.c: New tests. --- It would incidentally now be appropriate to update the Unicode data in libcpp from Unicode 14 to Unicode 15. diff --git a/gcc/testsuite/gcc.dg/cpp/c2x-ucnid-1-utf8.c b/gcc/testsuite/gcc.dg/cpp/c2x-ucnid-1-utf8.c new file mode 100644 index 00000000000..55d22819563 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/c2x-ucnid-1-utf8.c @@ -0,0 +1,13 @@ +/* Test C2x (= Unicode) rules for characters in identifiers. */ +/* { dg-do preprocess } */ +/* { dg-options "-std=c2x -pedantic-errors" } */ + +¨ + +/* The requirement for NFC only applies in identifiers, not pp-numbers. */ + +À /* { dg-error "not in NFC" } */ +ÿÀ /* { dg-error "not in NFC" } */ + +0À /* { dg-warning "not in NFC" } */ +.1À /* { dg-warning "not in NFC" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/c2x-ucnid-1.c b/gcc/testsuite/gcc.dg/cpp/c2x-ucnid-1.c new file mode 100644 index 00000000000..f9fdbea6ece --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/c2x-ucnid-1.c @@ -0,0 +1,13 @@ +/* Test C2x (= Unicode) rules for characters in identifiers. */ +/* { dg-do preprocess } */ +/* { dg-options "-std=c2x -pedantic-errors" } */ + +\u00A8 /* { dg-error "is not valid in an identifier" } */ + +/* The requirement for NFC only applies in identifiers, not pp-numbers. */ + +A\u0300 /* { dg-error "not in NFC" } */ +\u00ffA\u0300 /* { dg-error "not in NFC" } */ + +0A\u0300 /* { dg-warning "not in NFC" } */ +.1A\u0300 /* { dg-warning "not in NFC" } */ diff --git a/libcpp/charset.cc b/libcpp/charset.cc index 6834969a919..12a398e7527 100644 --- a/libcpp/charset.cc +++ b/libcpp/charset.cc @@ -1291,7 +1291,7 @@ ucn_valid_in_identifier (cpp_reader *pfile, cppchar_t c, valid_flags = C99 | CXX | C11 | CXX23; if (CPP_PEDANTIC (pfile)) { - if (CPP_OPTION (pfile, cplusplus)) + if (CPP_OPTION (pfile, xid_identifiers)) valid_flags = CXX23; else if (CPP_OPTION (pfile, c11_identifiers)) valid_flags = C11; @@ -1355,7 +1355,7 @@ ucn_valid_in_identifier (cpp_reader *pfile, cppchar_t c, return 2; } - if (CPP_OPTION (pfile, cplusplus)) + if (CPP_OPTION (pfile, xid_identifiers)) invalid_start_flags = NXX23; else if (CPP_OPTION (pfile, c11_identifiers)) invalid_start_flags = N11; diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index e97993e04bc..d5ef12a30ea 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -496,6 +496,10 @@ struct cpp_options in C11. */ unsigned char c11_identifiers; + /* Nonzero means extended identifiers allow the characters specified + by Unicode XID_Start and XID_Continue properties. */ + unsigned char xid_identifiers; + /* Nonzero for C++ 2014 Standard binary constants. */ unsigned char binary_constants; diff --git a/libcpp/init.cc b/libcpp/init.cc index d3b4f00994b..5f34e3515d2 100644 --- a/libcpp/init.cc +++ b/libcpp/init.cc @@ -82,6 +82,7 @@ struct lang_flags char extended_numbers; char extended_identifiers; char c11_identifiers; + char xid_identifiers; char std; char digraphs; char uliterals; @@ -102,31 +103,31 @@ struct lang_flags }; static const struct lang_flags lang_defaults[] = -{ /* c99 c++ xnum xid c11 std digr ulit rlit udlit bincst digsep trig u8chlit vaopt scope dfp szlit elifdef warndir delim trufal */ - /* GNUC89 */ { 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 }, - /* GNUC99 */ { 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 }, - /* GNUC11 */ { 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 }, - /* GNUC17 */ { 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 }, - /* GNUC2X */ { 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1 }, - /* STDC89 */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - /* STDC94 */ { 0, 0, 0, 0, 0, 1, 1, 0,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, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1 }, - /* CXX20 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1 }, - /* GNUCXX23 */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 }, - /* CXX23 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 }, - /* ASM */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +{ /* c99 c++ xnum xid c11 xidid std digr ulit rlit udlit bincst digsep trig u8chlit vaopt scope dfp szlit elifdef warndir delim trufal */ + /* GNUC89 */ { 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 }, + /* GNUC99 */ { 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 }, + /* GNUC11 */ { 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 }, + /* GNUC17 */ { 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 }, + /* GNUC2X */ { 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1 }, + /* STDC89 */ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + /* STDC94 */ { 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 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 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1 }, + /* CXX20 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1 }, + /* GNUCXX23 */ { 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 }, + /* CXX23 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 }, + /* ASM */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; /* Sets internal flags correctly for a given language. */ @@ -142,6 +143,7 @@ cpp_set_lang (cpp_reader *pfile, enum c_lang lang) CPP_OPTION (pfile, extended_numbers) = l->extended_numbers; CPP_OPTION (pfile, extended_identifiers) = l->extended_identifiers; CPP_OPTION (pfile, c11_identifiers) = l->c11_identifiers; + CPP_OPTION (pfile, xid_identifiers) = l->xid_identifiers; CPP_OPTION (pfile, std) = l->std; CPP_OPTION (pfile, digraphs) = l->digraphs; CPP_OPTION (pfile, uliterals) = l->uliterals; diff --git a/libcpp/lex.cc b/libcpp/lex.cc index a429a3d44ce..cc12a52d282 100644 --- a/libcpp/lex.cc +++ b/libcpp/lex.cc @@ -2007,7 +2007,8 @@ name_p (cpp_reader *pfile, const cpp_string *string) static void warn_about_normalization (cpp_reader *pfile, const cpp_token *token, - const struct normalize_state *s) + const struct normalize_state *s, + bool identifier) { if (CPP_OPTION (pfile, warn_normalize) < NORMALIZE_STATE_RESULT (s) && !pfile->state.skipping) @@ -2043,7 +2044,7 @@ warn_about_normalization (cpp_reader *pfile, if (NORMALIZE_STATE_RESULT (s) == normalized_C) cpp_warning_at (pfile, CPP_W_NORMALIZE, &rich_loc, "`%.*s' is not in NFKC", (int) sz, buf); - else if (CPP_OPTION (pfile, cplusplus)) + else if (identifier && CPP_OPTION (pfile, xid_identifiers)) cpp_pedwarning_at (pfile, CPP_W_NORMALIZE, &rich_loc, "`%.*s' is not in NFC", (int) sz, buf); else @@ -3839,7 +3840,7 @@ _cpp_lex_direct (cpp_reader *pfile) struct normalize_state nst = INITIAL_NORMALIZE_STATE; result->type = CPP_NUMBER; lex_number (pfile, &result->val.str, &nst); - warn_about_normalization (pfile, result, &nst); + warn_about_normalization (pfile, result, &nst, false); break; } @@ -3888,7 +3889,7 @@ _cpp_lex_direct (cpp_reader *pfile) result->val.node.node = lex_identifier (pfile, buffer->cur - 1, false, &nst, &result->val.node.spelling); - warn_about_normalization (pfile, result, &nst); + warn_about_normalization (pfile, result, &nst, true); } /* Convert named operators to their proper types. */ @@ -4101,7 +4102,7 @@ _cpp_lex_direct (cpp_reader *pfile) struct normalize_state nst = INITIAL_NORMALIZE_STATE; result->type = CPP_NUMBER; lex_number (pfile, &result->val.str, &nst); - warn_about_normalization (pfile, result, &nst); + warn_about_normalization (pfile, result, &nst, false); } else if (*buffer->cur == '.' && buffer->cur[1] == '.') buffer->cur += 2, result->type = CPP_ELLIPSIS; @@ -4192,7 +4193,7 @@ _cpp_lex_direct (cpp_reader *pfile) result->type = CPP_NAME; result->val.node.node = lex_identifier (pfile, base, true, &nst, &result->val.node.spelling); - warn_about_normalization (pfile, result, &nst); + warn_about_normalization (pfile, result, &nst, true); break; }