From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34883 invoked by alias); 15 Jan 2019 15:50:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 34868 invoked by uid 89); 15 Jan 2019 15:50:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=van X-HELO: smtp121.iad3b.emailsrvr.com Received: from smtp121.iad3b.emailsrvr.com (HELO smtp121.iad3b.emailsrvr.com) (146.20.161.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 15 Jan 2019 15:50:42 +0000 Received: from smtp8.relay.iad3b.emailsrvr.com (localhost [127.0.0.1]) by smtp8.relay.iad3b.emailsrvr.com (SMTP Server) with ESMTP id 402AD4053D; Tue, 15 Jan 2019 10:50:41 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=honermann.net; s=20180930-2j89z3ji; t=1547567441; bh=DNDEiyn9W4uvJu+ZMEkxGuROxjG4QSpFGZaxHunB/5E=; h=Subject:To:From:Date:From; b=JdHLyIhfJ+/Qk4iVicWdAzQ94SoaRtzFmL8KcFLew9FMOqxWxudhezzLy/ZsgtCdu NCEEXXgwcJig3br7rBx6B4f4oa+jgq0f0mX862puajYO3j8b+Ix0Y3ikP3H/ZyNGb2 vsmemqjexNPEnvelp7uJgjU9FXv7UWLlU2TfJYy4= X-Auth-ID: tom@honermann.net Received: by smtp8.relay.iad3b.emailsrvr.com (Authenticated sender: tom-AT-honermann.net) with ESMTPSA id 0CF0B40553; Tue, 15 Jan 2019 10:50:41 -0500 (EST) X-Sender-Id: tom@honermann.net Received: from [192.168.1.27] (pool-71-176-235-158.rcmdva.fios.verizon.net [71.176.235.158]) (using TLSv1.2 with cipher AES128-SHA) by 0.0.0.0:25 (trex/5.7.12); Tue, 15 Jan 2019 10:50:41 -0500 Subject: Re: [REVISED PATCH 2/9]: C++ P0482R5 char8_t: Core language support To: Christophe Lyon , Jason Merrill Cc: gcc-patches References: <84731895-95a5-f4d3-f444-169fa7441080@honermann.net> From: Tom Honermann Message-ID: <6b5fa6fa-be71-7bae-527f-162c01a821d1@honermann.net> Date: Tue, 15 Jan 2019 15:50:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------835F2D2DCFA1DF4ED37447D1" X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00851.txt.bz2 This is a multi-part message in MIME format. --------------835F2D2DCFA1DF4ED37447D1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-length: 1907 On 1/15/19 1:51 AM, Christophe Lyon wrote: > On Mon, 14 Jan 2019 at 20:59, Jason Merrill wrote: >> On 12/23/18 9:27 PM, Tom Honermann wrote: >>> Attached is a revised patch that addresses changes in P0482R6 as well as >>> feedback provided by Jason. Changes from the prior patch include: >>> - Updated the value of the __cpp_char8_t feature test macro to 201811 >>> per P0482R6. >>> - Enable char8_t support with -std=c++2a per adoption of P0482R6 in >>> San Diego. >>> - Reverted the unnecessary changes to gcc/gcc/c/c-typeck.c as requested >>> by Jason. >>> - Removed unnecessary checks of 'flag_char8_t' within the C++ front >>> end as requested by Jason. >>> - Corrected the regression spotted by Jason regarding initialization of >>> signed char and unsigned char arrays with string literals. >>> - Made minor changes to the error message emitted for ill-formed >>> initialization of char arrays with UTF-8 string literals. These >>> changes do not yet implement Jason's suggestion; I'll follow up with a >>> separate patch for that due to additional test impact. >>> >>> Tested on x86_64-linux. >> I just applied the compiler changes with small modifications, as >> follows; thank you very much for the patches. Jonathan should check in >> the library portion before long. >> >> Jason > Hi, > > The new testcase g++.dg/ext/utf-cvt-char8_t.C fails at least on arm and aarch64: > > g++.dg/ext/utf-cvt-char8_t.C -std=gnu++14 (test for warnings, line 24) > g++.dg/ext/utf-cvt-char8_t.C -std=gnu++17 (test for warnings, line 24) Arm and aarch64 have unsigned char by default, so the warning ("conversion to 'char' from 'char8_t' may change the sign of the result") isn't emitted on those platforms.  I presume adding '-fsigned-char' to the options for the test would be a sufficient fix?  If so, a patch is attached. Tom. > > Christophe --------------835F2D2DCFA1DF4ED37447D1 Content-Type: text/x-patch; name="test-utf-cvt-char8_t.C.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="test-utf-cvt-char8_t.C.diff" Content-length: 648 Index: gcc/testsuite/g++.dg/ext/utf-cvt-char8_t.C =================================================================== --- gcc/testsuite/g++.dg/ext/utf-cvt-char8_t.C (revision 267930) +++ gcc/testsuite/g++.dg/ext/utf-cvt-char8_t.C (working copy) @@ -1,7 +1,7 @@ /* Contributed by Kris Van Hees */ /* Test the char8_t promotion rules. */ /* { dg-do compile { target c++11 } } */ -/* { dg-options "-fchar8_t -Wall -Wconversion -Wsign-conversion -Wsign-promo" } */ +/* { dg-options "-fchar8_t -fsigned-char -Wall -Wconversion -Wsign-conversion -Wsign-promo" } */ extern void f_c (char); extern void fsc (signed char); --------------835F2D2DCFA1DF4ED37447D1--