From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Evan Klitzke Newsgroups: gmane.emacs.bugs Subject: bug#51092: [PATCH] Recognize consteval and constinit modifiers in C++ Date: Thu, 14 Oct 2021 14:22:22 -0400 Message-ID: References: <8735pbrd91.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2338"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51092@debbugs.gnu.org, Lars Ingebrigtsen To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 14 20:23:18 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mb5Ns-0000L4-VI for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Oct 2021 20:23:17 +0200 Original-Received: from localhost ([::1]:58440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb5Nr-0007Dp-0w for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Oct 2021 14:23:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb5Nf-0007DF-0A for bug-gnu-emacs@gnu.org; Thu, 14 Oct 2021 14:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb5Ne-0007nZ-NQ for bug-gnu-emacs@gnu.org; Thu, 14 Oct 2021 14:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mb5Ne-0008C4-8U for bug-gnu-emacs@gnu.org; Thu, 14 Oct 2021 14:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Evan Klitzke Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Oct 2021 18:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51092 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51092-submit@debbugs.gnu.org id=B51092.163423576331452 (code B ref 51092); Thu, 14 Oct 2021 18:23:02 +0000 Original-Received: (at 51092) by debbugs.gnu.org; 14 Oct 2021 18:22:43 +0000 Original-Received: from localhost ([127.0.0.1]:37068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mb5NK-0008BE-Ri for submit@debbugs.gnu.org; Thu, 14 Oct 2021 14:22:43 -0400 Original-Received: from mail-lf1-f50.google.com ([209.85.167.50]:43654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mb5NH-0008Az-Fw for 51092@debbugs.gnu.org; Thu, 14 Oct 2021 14:22:42 -0400 Original-Received: by mail-lf1-f50.google.com with SMTP id r19so29693066lfe.10 for <51092@debbugs.gnu.org>; Thu, 14 Oct 2021 11:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eklitzke.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xJoCcINKFuVmbaiZ/2FPKJEExIDWBGkrxUJq9w7PUo8=; b=SQSDL5kE+7mUwUnUvqEUfDzeBVZ5Q0x0DmRFq621Eah53indC7ecdpWpLOYwswf/XN k9WIdSfj1A2zEHbiKklYPDxi2X9QDP8AnO47eJMD/LkDTzJcUgbVaCfGZGZfAvEtVFpZ lu6cKE2tPBJm/OVkBN0une3lMii00NPpqh8Qk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xJoCcINKFuVmbaiZ/2FPKJEExIDWBGkrxUJq9w7PUo8=; b=SnBV/ZlpLdYIFn35CloKJg0pEdnZiDf2i0Cy0QdYAAv7hDN+ccaHHnfZDEED2zlULH 5j2E3KlE1uokuAqEC/R2g/WY2kRMAfbr1e/Rp374fpjmoSEtEPAc1zSJX1QgKA5LlyoF T5zphw8qOswpBKD2qWWpbzWk4CPFflLoX+7gBBa5cxR7xZ0ODCQGvbRT9cdoBZ9REQ10 jIMnTDNHSNXsmaQd0skRywwU9iQUm8fMg9gzIpo6Bj1+3w1EqQ4LFVysEw0TR1ergaoj gWq7liyV87Ope3ZSfhl2aUWvkAJ2SA2jRdfMQ3mPrlX/+wh5nMZ/ACGkcUrkOc2byRFl x8OA== X-Gm-Message-State: AOAM533w9QRvRvSLmU5zgb0/bYbaUj/G8jT62W2etmb8YXCm0B+4Xw9+ zozp35t0QTDZVS56fz4Hbwt5w1y/L23p6B6UB7aMqg== X-Google-Smtp-Source: ABdhPJxD5qiN11IkxPepZKCFGD19kfBXwqpq98oxmqdUhACF7fq0bYnQ45X5GZY4X8RcBSzJpjmbpNqCxNlkoEZEF2A= X-Received: by 2002:a19:c78c:: with SMTP id x134mr6751800lff.97.1634235753422; Thu, 14 Oct 2021 11:22:33 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:217255 Archived-At: On Tue, Oct 12, 2021 at 6:54 AM Alan Mackenzie wrote: > As the maintainer of CC Mode, i'm in two minds over this. It's clearly > a step in the right direction. But there's a non-trivial amount of work > to be done to implement C++20's new features, and having just those few > new keywords and nothing else in the release branch might jar. It doesn't necessarily have to be in the release branch, I just thought it would be nice since it's such a small change. But I'm not too familiar with the branching process of Emacs or how much work that is. > Evan, you've clearly burrowed a fair way into CC Mode, and have some > idea of how complicated it is. Do you perhaps feel able and willing to > add a larger part of C++20's new feature set to CC Mode? Regular > discussion and help from me would, of course, be available. I envisage > starting off in the CC Mode standalone project, and transferring the new > features steadily to the Emacs master branch as they become ready; this > has been my standard way of working for many years. The standalone > project is at SourceForge, and uses Mercurial (which is easy to learn) > rather than git. I'm far from an expert at elisp but I'm happy to review and test changes to cc mode, and discuss them. I did look through some other parts of the cc mode code and it is pretty daunting. I don't mind working with sourceforge or mercurial. I'm curious, do you have an idea of what other C++20 features need more support in cc mode? One thing I did notice when making this change is that some modifiers in C++ should only apply to variable declarations (e.g. mutable, thread_local, constinit), some apply only to function declarations (e.g. virtual, consteval), and some can apply to either (e.g. constexpr), and currently the cc mode code doesn't distinguish between these cases. But this isn't exactly a C++20 thing, since it applies to many of the existing keywords. -- evan klitzke https://eklitzke.org/