From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 6221E3857705 for ; Wed, 13 Sep 2023 20:50:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6221E3857705 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694638219; h=from:from:reply-to:subject:subject: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=z3E4BExvFt6sh68cIB5FQTlQo67qBbwqkxo0QXi3Y7Q=; b=Kr/CFH57UbDFyXHrvC7J/EkSjh8hOGOLT/j6dR/vfD3/EuXzQnECNwsm53KewA7a5lYmiu OLOMZGu8lTPYL2M48/F+2p3wsZ/YEsbo1EAl9xWoCPtdFeGqO7V5dRTGjntDxTnKChXc/e ehiPQfsaPpnpFSZDwSS2jvynzSm57YI= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-4AhEhfzgPRyEQRzeTKaKvg-1; Wed, 13 Sep 2023 16:50:18 -0400 X-MC-Unique: 4AhEhfzgPRyEQRzeTKaKvg-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2b6ff15946fso2386351fa.2 for ; Wed, 13 Sep 2023 13:50:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694638215; x=1695243015; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z3E4BExvFt6sh68cIB5FQTlQo67qBbwqkxo0QXi3Y7Q=; b=ulis0mLhKoVjL8/vtlFGqsU3xvccAugANy3/nRcg1dMsVZVvFlk3w//YYsNPbChIOH yrkZi8TQGYE9U55/nCGXShCZ96Yuatzb13EzKgrsLLz/ADxOfhiFR2SXJuLopNuFA9+e jsXpSsMKQ/fY/Smj4i/KJR0a0tHhHeiX1fRPUdR2m1nB04r8M/DrM4UMVwCf8I26hMGl RGo4e1olbLac/AHbyENRCM+QXiOFDBCOHswN69QNgw/F3lKs0bxOvLa8QntkykVyclNi hNCqgX+dKtA39YMWVObUpZ4OpGPilgRSuPSNRyG/hWU72OlfYtjRFq8dDdhguWSXWAQG yNFQ== X-Gm-Message-State: AOJu0YwZ4YZDTKZRAJiDSGIL6vBz76gFBknTvtkAQ77UiuJvdc/dQoxk U5j1mkGshtorIuJrpE9jxWMpudUQ/UeDjjJ8MAeQlgV83dDP1KELv9We59uNMBkLhRFSSQsl3HS OyG9TV4zt6Odtoc17tkldAPNtWTsoft0= X-Received: by 2002:a2e:a28c:0:b0:2bc:b9cd:8bc2 with SMTP id k12-20020a2ea28c000000b002bcb9cd8bc2mr3302978lja.4.1694638215658; Wed, 13 Sep 2023 13:50:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGNM+ipGkTHX7wldXiCTvhl6xDxOd56Fpj48xzZ/7WbOU5BlicOqdQa0PpYgOb0bAlVaJoplsymaECWTVD0Zh4= X-Received: by 2002:a2e:a28c:0:b0:2bc:b9cd:8bc2 with SMTP id k12-20020a2ea28c000000b002bcb9cd8bc2mr3302971lja.4.1694638215278; Wed, 13 Sep 2023 13:50:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Wed, 13 Sep 2023 21:50:03 +0100 Message-ID: Subject: Re: [PATCH][_GLIBCXX_INLINE_VERSION] Fix friend declarations To: =?UTF-8?Q?Fran=C3=A7ois_Dumont?= Cc: "libstdc++" , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 13 Sept 2023 at 21:47, Fran=C3=A7ois Dumont = wrote: > > It's working and what's I've committed. Nice, thanks! > > Thanks > > On 12/09/2023 19:04, Jonathan Wakely wrote: > > On Tue, 12 Sept 2023 at 17:47, Jonathan Wakely wro= te: > >> On Wed, 23 Aug 2023 at 18:35, Fran=C3=A7ois 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 frien= d > >>> 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 va= lues. > > // 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 declar= ations > >>> > >>> 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 gi= ving > >>> 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=C3=A7ois >