From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id EC1A43858D1E; Sun, 6 Aug 2023 19:43:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC1A43858D1E 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-lj1-x236.google.com with SMTP id 38308e7fff4ca-2b9a2033978so59438631fa.0; Sun, 06 Aug 2023 12:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691351007; x=1691955807; 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=BO5UomhJxoaaz1C9G/rsRXkBg3gDkEfmGRs9Pi5KyLY=; b=E23Crb0SdYhUFOSWVUmkrYvmYFnf9ol1zEt5s3qFLaV9EbcwLRsnw3B6/yK1Jbbjps KfzS0yDo67aWVeu0YxjmfYd8digvrkcepYp0z6BqFcfajQZNKcnukDCTHG16z3wrdGDl ERzIfLlhkGlTdhDFxWPZx2xaF/QadS0oH9yLcuMPmtbAuA0lbG1iqsISlEn9tAh+9Nqc irV2Tc39q2w74ksA6G5+RTRozmRHJwVVAduFMmCetUaX8+RgaJlBKa2esJgx2ANHwXtz QoinZE3qzrINRHWxBWQ5qO17j8EjhPZoMtQQStGsAVnpAbilrH6ZNt4kso70wcL5wNTA vCjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691351007; x=1691955807; 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=BO5UomhJxoaaz1C9G/rsRXkBg3gDkEfmGRs9Pi5KyLY=; b=MOMhkCAKfxJ9PlYr8E0HRHwkDZ+aa4RimIzJuK4hv6tuiStrMvJpH8gdRjEnoCreDu FkC7TcVxxk7IwcGn4TxGiPxqruhhMqRVINLWofqqQOgUi7DxJDwKQhyk1p/ueFqvIqYD AMOU+RmhgeizrBaM8HYX1CPPbJIMp8PcLSfT6DYmu7fDo73Ogy01OxfQcSsOMeb+LCPc slBNsY5zP244ofb9nZyjkCI/rfv9gVRm7fgMDdE7bZu5q+2XwwTQFJYZHo59WAJiFY1Y 7GCHtEC8/BUkRo1wsTx8T0/k/59obBMbgNT38ozjtymgIrgYFza40jIMv26aPnGTBK75 XZjA== X-Gm-Message-State: AOJu0YykQ8dSORZOOq1YDzc1xag3QbcbcrYXmAS1NNFxNHQpUMZV6uzX fNj8pbYInwzKI1rv9IOaGZWz1K6+ojZD+e1l838= X-Google-Smtp-Source: AGHT+IHtiMb/KlO+L53ht1E1sWmFnjj9Nx97Xjs3B3iw7b7uxrTqZEIvAlUIvlDXzjCipBBRHRMSvV6c3VcVBJ/fkZI= X-Received: by 2002:a2e:850b:0:b0:2b9:581d:73bb with SMTP id j11-20020a2e850b000000b002b9581d73bbmr4912911lji.26.1691351007155; Sun, 06 Aug 2023 12:43:27 -0700 (PDT) MIME-Version: 1.0 References: <3A4C9996-750B-4E3F-8F30-E3DA4366C7B5@berlin.de> In-Reply-To: From: Jonathan Wakely Date: Sun, 6 Aug 2023 20:43:16 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 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 language > > extensions from later standards ( > > https://discourse.llvm.org/t/rfc-use-language-extensions-from-future-st= andards-in-libc/71898/4). > > By that I mean things like using `if constexpr` with `-std=3Dc++11`. GC= C has > > quite a lot of these kinds of conforming extensions, but doesn't docume= nt > > them AFAICT. While discussing using these extensions, the question came= up > > what GCCs support policy for these is. Aaron was kind enough to answer > > these questions for us on the Clang side. Since I couldn't find anythin= g 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 reaso= n? > > 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++0= 3 > 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++ folks= , > 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. > > Would you be interested in documenting them? > > > > That would be useful, yes. > > There is a patch in review to add __has_feature/__has_extension to G++, > which would seem like a suitable context for this documentation. > > Aaron noted that we should ask the Clang folks before using them, so they > > can evaluated whether the extension makes sense, since they might not b= e > > aware of them, and some might be broken. So I'd be interested whether y= ou > > would also like us to ask whether you want to actually support these > > extensions. > > > > Sounds good. > > Jason