From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id D9D403856243 for ; Thu, 5 May 2022 12:56:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D9D403856243 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 900FF1F8BD; Thu, 5 May 2022 12:56:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1651755369; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZS3Eeo1HjPq7BPhJRKCQf3dwrI4flS7Ht617CPxbOmw=; b=sh9x8HgphRofMxb/uXaeuGjRpVArAIzLqaAKA+Lhigau5nNrN2p69Wk/7mpE5tFyhjRmdj J91RTuL/DSW7brZc00rPxMBfjDcDa6w3pbFT11y/sOU5RzxPr7FlSL0vXpcGg1X6ExcQ/v G3A7jJJO8zMH5d2yFJkRnxYrZ4IU7zo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1651755369; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZS3Eeo1HjPq7BPhJRKCQf3dwrI4flS7Ht617CPxbOmw=; b=5Unl+cfFHNqMVFZ3IVP8eSTsoFsKdAGEvuhgYxi/AimpYroUnZzxAeD30jIvNFey7kP/5T WbnrXAkNPYyzvoBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6E83913B11; Thu, 5 May 2022 12:56:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jEcfGmnJc2IiDgAAMHmgww (envelope-from ); Thu, 05 May 2022 12:56:09 +0000 Message-ID: Date: Thu, 5 May 2022 14:56:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH] Remove conditional STATIC_ASSERT. Content-Language: en-US To: Pedro Alves , Richard Biener Cc: GCC Patches References: <60e9783e-d324-2d12-5744-68a3b2e5c96a@suse.cz> <6a3b7979-46ff-cc47-fd46-f0f799bad39c@suse.cz> <8cc0a6a6-b10f-60f2-b7d2-5a68226ed834@palves.net> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: <8cc0a6a6-b10f-60f2-b7d2-5a68226ed834@palves.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Thu, 05 May 2022 12:56:12 -0000 On 5/5/22 14:51, Pedro Alves wrote: > On 2022-05-05 13:41, Martin Liška wrote: >> On 5/5/22 14:29, Richard Biener wrote: >>> Can we then use static_assert (...) instead and remove the >>> macro? >> >> Oh yes, we can ;) >> >>> Do we have C compiled code left (I think we might, >>> otherwise we'd not have __cplusplus guards in system.h), >>> in which case the #if should change to #ifdef __cplusplus? >> >> No, there's no such a consumer of the macro. >> >> What about the updated version of the patch? > > static_assert without the second/message parameter requires C++17: > > https://en.cppreference.com/w/cpp/language/static_assert Oh, you are correct :) Thanks: /home/marxin/Programming/gcc/gcc/wide-int.h: In static member function ‘static wide_int wi::int_traits::get_binary_result(const T1&, const T2&)’: /home/marxin/Programming/gcc/gcc/wide-int.h:1205:60: warning: ‘static_assert’ without a message only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wpedantic] 1205 | || wi::int_traits ::precision_type != FLEXIBLE_PRECISION); > > The macro expanded to always have a message argument. That said, we should go with the original version of the patch. Cheers, Martin