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.129.124]) by sourceware.org (Postfix) with ESMTPS id 959A9385770C for ; Thu, 11 Jan 2024 13:53:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 959A9385770C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 959A9385770C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704981223; cv=none; b=ViAGYIqiCQNhcFEnrRR9FL8yPygPLamWU6/TwfDSQEyxEvF7LL1MsIjFA9xqlEWYEcJU2r2K+uYncxdWOXBZGDW9YsWunjU/U/8557soNKOS5HO0V10BhoVAItR9WpLwqVDLx4kAqL4aXvgRAirLCtw1MH6rhEQc+yvMVrdEv+g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704981223; c=relaxed/simple; bh=4ncTnLevqYh+vleLDUlXwy1F8ttRy1mZ+Tmxfsh1G9Y=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=rotvShqcY48ZR1bNZRXz4axgr+Q2RT8A2aDSXDUxb3j3xjXVain18IuQyJYfuh0C1hgwt4+aExWko/rF4as+e0swKL+Rzv+fT5e5PJ6otCA90lNh+c5NOyfNogFXSD9nAzRjxW1huEHnyir2Zx6nEF4d/ZvqiY4gYgEyzYRtdLE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704981221; 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=N6IyXEfJAsAekaSK70TvYpS5dzOVfnoqJjPB9mI0SnA=; b=U2N0N7v9vMVIqaUKtbEEGtCseEtQLqw/R75g0zUTIE5psqYNn177Lag5RV2Fh5AxDIXMy6 LFYXSoD6GUhM4GBI3URHZeyPMdQ20cggemco4iBbFx7qb5Jfyhdg7n2fU4KVAV2p0+afuO Iinv//LGIe1n+S6Z3uETTHlN9Dh6/us= Received: from mail-yb1-f198.google.com (mail-yb1-f198.google.com [209.85.219.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-R8G6J34UNE-sv8_72FZ15g-1; Thu, 11 Jan 2024 08:53:40 -0500 X-MC-Unique: R8G6J34UNE-sv8_72FZ15g-1 Received: by mail-yb1-f198.google.com with SMTP id 3f1490d57ef6-dbf3ea4a586so1044880276.3 for ; Thu, 11 Jan 2024 05:53:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704981219; x=1705586019; 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=N6IyXEfJAsAekaSK70TvYpS5dzOVfnoqJjPB9mI0SnA=; b=X4fbEPvPY/OoMYkIHEkP1Kt6li2J6VVIuOKGXZ82TRkup+AbsMVULFw/K4ZZV3jH/7 S/t7qT1G4/lQ7/sYqnfACAE0vuOE6r1/4S3qpeYy+7yGhrvyMy5Roj/eRf43BOR1B7SO 16TaHf2Y003HBnSJawty8VPN3rhtD34uHyiRq9KEcbpEmyP1UVkck330D8wNhRwhmOkq +FQUWvTZ9qDw9W0Kqc5gd7o1MQfXCBEwxhF4ruvt3YpuYwnLcyRoqHGIZxwzYiCZA5B0 dhjzVNMMdJb4ypYb1SRDBpq1ejunma7XJQx4bNazYaAKgc2K7BJiJG9iaS/Z1Nq6Mn/6 Ws6A== X-Gm-Message-State: AOJu0Ywdslb10ijLDPPxFTTTUCBsrngQ36IQVaqijCiY+WG7Ql0dyhNA u3ekweQJiQ9e0WQrd4zrs01wosaoZ7/MV3O0PByZui4p11qtUSQsIj5681FdW3T9bNwuw5JPayZ yHrhB0TZkG2j8ye7/lFGmTSxLLs1bGosDiBucsoI= X-Received: by 2002:a25:d050:0:b0:dbf:2212:a4df with SMTP id h77-20020a25d050000000b00dbf2212a4dfmr1209724ybg.29.1704981219724; Thu, 11 Jan 2024 05:53:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeK5jVZD1TLDtQwGQlToEhM6V2rkhtmzoXdOUcoRsEZTsVVY6fYEfiMvyo+ZNuzZ1UWL8B96H94C9btU3U9+4= X-Received: by 2002:a25:d050:0:b0:dbf:2212:a4df with SMTP id h77-20020a25d050000000b00dbf2212a4dfmr1209717ybg.29.1704981219538; Thu, 11 Jan 2024 05:53:39 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Thu, 11 Jan 2024 13:53:23 +0000 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=-7.5 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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: On Wed, 13 Sept 2023 at 21:50, Jonathan Wakely wrote: > > 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 w= rote: > > >> 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 fri= end > > >>> declarations. > > >>> > > >>> 2. Consider it as a compiler bug and do nothing. In this case I thi= nk we > > >>> might still need this patch to avoid a non-working format library i= n > > >>> 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 Except that should be 59256 :-( My fault, I'll fix it. > > > + 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 decl= arations > > >>> > > >>> GCC do not consider the inline namespace in friend declaratio= ns. 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=C3=A7ois > >