From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 375153858D20; Wed, 13 Sep 2023 20:47:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 375153858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-403012f276dso2580025e9.0; Wed, 13 Sep 2023 13:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694638065; x=1695242865; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=dHn6uGQYwR06l1Z49KPAkaORq8VQhVDCGnt164kx6SM=; b=hSC9ofJAnJHid1fw0uTr97TB/4lLkqOR3tigELsJAXVkZqBPUNk7pw5URLIwXEMeF8 HqDRCpBH65rjiRRxbWcAkvCuMq343snSz7omZmiN43t1+GxnersOLo8ZjRgamp4U0MJT bN2GAPAEl9ZTYzfElpJ1isswB5/qw/qBw9O6FkvADipvaF7rTZmqD4sa8phKd7YuncmW tm0XFAomjvELVElD4YbgI2tfZetO5eErLYD2NJABHO0+mwT/5v9psS4dwhJt7FdAc/MT qQtC/IJbIJvvUwlUpSmClTd1BCFZTn5kxoc23YF7/M8g0KJZIObF9+cSv5ARIAZsaLKO PSZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694638065; x=1695242865; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dHn6uGQYwR06l1Z49KPAkaORq8VQhVDCGnt164kx6SM=; b=kLN4QxjZm66tQC/MtjHvePddMkIrZeTCOrDRPrrRdm18IfS/LBh/HRRJQd9XA+Mu9Q iT/Ktyt6ZLQNgRZ7kY8Kk+4uDrMSRQFMGjOaZTAIzJ8do7Sof+0EtDq/Mhn+TQ0m6f+9 nbrS5a8b2PnvUaSQyVa115r3U938Msxg5igWNi4jcJZPxi/qK4DpZdX3PUab5vc1YeuM Ly1LwZI6mRspi4nucH6QRtjFegpSJFkyg0cv+wQU3WO/CRQ2GVHzU3XS4Qrrra6hyZbN ZBEhdMQn4t9OLifhNAnM/TCa9xrguVkUKfs2jDexEKuHQcMcQd5KdHpiQAg7jVfDGnza Tw3Q== X-Gm-Message-State: AOJu0Yz0ztend3KIMWd1lvg/mGgu9i6wrUucWSBUe8F+8vPLyqKCA8WO 7F9jiMb9NwFjqDhjyVwZV6s= X-Google-Smtp-Source: AGHT+IEzBChfsYBWloVsiX1QkwNTAOHnP4yZjL12vFZ8ILER3uFOn5V/8YG08Gy9mRoMNnMKvrkzYw== X-Received: by 2002:a1c:ed16:0:b0:401:b204:3b85 with SMTP id l22-20020a1ced16000000b00401b2043b85mr2800675wmh.36.1694638065168; Wed, 13 Sep 2023 13:47:45 -0700 (PDT) Received: from ?IPV6:2a01:e0a:1dc:b1c0:3543:371b:5aac:bb67? ([2a01:e0a:1dc:b1c0:3543:371b:5aac:bb67]) by smtp.gmail.com with ESMTPSA id 7-20020a05600c020700b003fe2de3f94fsm119814wmi.12.2023.09.13.13.47.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Sep 2023 13:47:44 -0700 (PDT) Message-ID: Date: Wed, 13 Sep 2023 22:47:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH][_GLIBCXX_INLINE_VERSION] Fix friend declarations To: Jonathan Wakely Cc: libstdc++ , gcc-patches References: Content-Language: en-US From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 List-Id: It's working and what's I've committed. Thanks On 12/09/2023 19:04, Jonathan Wakely wrote: > On Tue, 12 Sept 2023 at 17:47, Jonathan Wakely wrote: >> On Wed, 23 Aug 2023 at 18:35, François Dumont via Libstdc++ >> wrote: >>> Hi >>> >>> The few tests that are failing in versioned namespace mode are due to >>> those friend declarations. >>> >>> This is a fix proposal even if I considered 2 other options: >>> >>> 1. Make __format::_Arg_store a struct and so do not bother with friend >>> declarations. >>> >>> 2. Consider it as a compiler bug and do nothing. In this case I think we >>> might still need this patch to avoid a non-working format library in >>> versioned namespace mode in gcc 14 if compiler bug is not fixed. >> It definitely is a compiler bug, this is PR c++/59256. >> >> Please add a comment to the new macro definition, so we remember to >> remove it when it's not needed: >> >> >> #if _GLIBCXX_INLINE_VERSION >> // Needed because of PR c++/59526 >> # define _GLIBCXX_STD_V std::__8 >> #else >> # define _GLIBCXX_STD_V std >> #endif >> >> >> OK with that change, thanks. > Actually, are you sure the friend std::basic_format_args declaration > needs to change? > > I only see errors for the friend function, not the friend class. So > this seems to fix it: > > --- a/libstdc++-v3/include/std/format > +++ b/libstdc++-v3/include/std/format > @@ -3437,7 +3437,13 @@ namespace __format > > template > friend auto > - std::make_format_args(_Argz&&...) noexcept; > +#if _GLIBCXX_INLINE_VERSION > + // Needed for PR c++/59526 > + std::__8:: > +#else > + std:: > +#endif > + make_format_args(_Argz&&...) noexcept; > > // For a sufficiently small number of arguments we only store values. > // basic_format_args can get the types from the _Args pack. > > > > >> >>> I can also define _GLIBCXX_STD_V at level to limit impact. >>> >>> libstdc++: [_GLIBCXX_INLINE_VERSION] Fix friend declarations >>> >>> GCC do not consider the inline namespace in friend declarations. We >>> need >>> to explicit this namespace. >>> >>> libstdc++-v3/ChangeLog: >>> >>> * include/bits/c++config (_GLIBCXX_STD_V): New macro giving >>> current >>> std namespace with optionally the version namespace. >>> * include/std/format (std::__format::_Arg_store): Use >>> latter on friend >>> declarations. >>> >>> Tested under versioned mode. >>> >>> Ok to commit ? >>> >>> François