From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by sourceware.org (Postfix) with ESMTPS id 3DD94385843E; Tue, 8 Aug 2023 08:55:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3DD94385843E 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-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-522ab557632so7183946a12.0; Tue, 08 Aug 2023 01:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691484918; x=1692089718; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=lQzXFjAiP/G0nWN4VTDTugd0N954g0RQOTWQJD0nvDg=; b=Gyo3Qo17I4U3sb9AHF5dEdepm7lnla4vk8yVTBcZQoFebhXtv2/XF6cldHSm2CMemd XKzlCVJJqiuwtoP5+gokr5xmJkNMB21C1tSuyGztjNvEEnQmKUBp2KPOvy3tZlAltZdB BgrVGKLPir7GLUsZBCHVtKzVDH1iaK6bp6IhXOFvGcr+18JX6v/ilukAn1ZydNw9NCCJ CkKdkrcUfMq3rJR+RoDAjhvSno8NNxxc0tEHteSz1HkjV/tKK83vpQXsn8A1D9hIZvWp o3lVVBk7cUJS2tiqkop3AFFYxjDgAzPEw3Cl6chubuAj/tm9o8VtCTBmPf8jd2SM8JHx QqoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691484918; x=1692089718; 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=lQzXFjAiP/G0nWN4VTDTugd0N954g0RQOTWQJD0nvDg=; b=D14c3jqLDfm+I5buFkr8ZCdbpJ0dvgI6FIBhX3ZP1YeyVCACfY+4nQJDNGqDEGBKsz TUWJEJoQivzGQqkmErThSC77EouZxpoCmLX2BnjjhlbNeq6C+d6VxGMW62Xw0RwpZoL7 A0mP1Ec5ulpAcxGMIxZ6V2x+nO3tA2IknMkK/WwNa59PCMQHgXjzUBQcbwt87nPFlSLp RCjV+3XfelRXO9iIJ4vvHzmSPtpfVmxBjcHVtsZkXb507714hV2OF6KoPtq0yWspKXhp G7ijUU0ykaPJ/f6Clg4JeF3b7eBZHscrkTzYyMLWKs3Og6yZjmn6I874VydHnaor5dXP /3NQ== X-Gm-Message-State: AOJu0YzKvG25V93jdfUVZNQ8TwJvwsX/vCghY/N8EXikpJoiZ2WJjwwe 1Z5mvtA/7tF4dTriHd0wplBN0PThMrdg6PyAcGs= X-Google-Smtp-Source: AGHT+IFKa5DS8bC1zF26N0xDx4uhvprLvCKgCo/OXmkPxUhkg7lmxLArgehQwvCu2lt/GizkjzJzTtygNYDkwE6o2/M= X-Received: by 2002:a17:906:220c:b0:99c:e1f4:2720 with SMTP id s12-20020a170906220c00b0099ce1f42720mr3188809ejs.30.1691484917525; Tue, 08 Aug 2023 01:55:17 -0700 (PDT) MIME-Version: 1.0 References: <3A4C9996-750B-4E3F-8F30-E3DA4366C7B5@berlin.de> In-Reply-To: From: Jonathan Wakely Date: Tue, 8 Aug 2023 09:55:06 +0100 Message-ID: Subject: Re: GCC support for extensions from later standards To: Jason Merrill Cc: Nikolas Klauser , gcc@gcc.gnu.org, Louis Dionne , Mark de Wever , aaron@aaronballman.com, "libstdc++" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,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: On Mon, 7 Aug 2023 at 14:04, Jonathan Wakely wrote: > > On Sun, 6 Aug 2023 at 20:43, Jonathan Wakely wrot= e: > > > > On Sun, 6 Aug 2023 at 20:20, Jason Merrill via Libstdc++ > > wrote: > > > > > > On Wed, Aug 2, 2023 at 12:02=E2=80=AFPM Nikolas Klauser > > > wrote: > > > > > > > Hi everyone! > > > > > > > > I'm working on libc++ and we are currently discussing using languag= e > > > > extensions from later standards ( > > > > https://discourse.llvm.org/t/rfc-use-language-extensions-from-futur= e-standards-in-libc/71898/4). > > > > By that I mean things like using `if constexpr` with `-std=3Dc++11`= . GCC has > > > > quite a lot of these kinds of conforming extensions, but doesn't do= cument > > > > them AFAICT. While discussing using these extensions, the question = came up > > > > what GCCs support policy for these is. Aaron was kind enough to ans= wer > > > > these questions for us on the Clang side. Since I couldn't find any= thing in > > > > the documentation, I thought I'd ask here. > > > > > > > > So, here are my questions: > > > > > > > > Do you expect that these extensions will ever be removed for some r= eason? > > > > If yes, what could those reasons be? > > > > > > > > > > Potentially, if they don't actually work properly in earlier standard > > > modes. I recently noticed that while we allow DMI and =3Ddefault in = C++03 > > > mode with a pedwarn, combining them doesn't work. > > > > > > Some of the extensions are needed by libstdc++ and are therefore well > > > tested; these are extremely unlikely to ever be removed. libstdc++ f= olks, > > > is there a list of these? > > > > We use variadic templates and long long in C++98. We use a DMI in > > __gnu_cxx::__mutex even in C++98. I don't think we unconditionally use > > anything else, because we can't rely on it being available when using > > non-GCC compilers, or when compiling with -Wsystem-headers -pedantic. > > We don't use if-constexpr before C++17 for example. > > Oh, but we do use __decltype in a few places. I thought of another one: we use __constinit in some C++11 code. But only inside the library, not in headers. I've recorded these at https://gcc.gnu.org/wiki/LibstdcxxHacking for now.