GNU bug report logs - #51092
[PATCH] Recognize consteval and constinit modifiers in C++

Previous Next

Package: emacs;

Reported by: Evan Klitzke <evan <at> eklitzke.org>

Date: Fri, 8 Oct 2021 03:24:01 UTC

Severity: normal

Tags: patch

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51092 in the body.
You can then email your comments to 51092 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#51092; Package emacs. (Fri, 08 Oct 2021 03:24:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Evan Klitzke <evan <at> eklitzke.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 08 Oct 2021 03:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Evan Klitzke <evan <at> eklitzke.org>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Recognize consteval and constinit modifiers in C++
Date: Thu, 7 Oct 2021 18:10:24 -0700
[Message part 1 (text/plain, inline)]
These two modifiers were introduced by C++20. The change is trivial
but I tested it locally on some code I have that uses these modifiers
and with this change the keywords are recognized as expected. I agree
to copyright assignment to the FSF, etc. Patch against master is
attached; I think this should be backported to the emacs-28 branch as
well.

-- 
evan klitzke
https://eklitzke.org/
[consteval.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51092; Package emacs. (Fri, 08 Oct 2021 11:03:02 GMT) Full text and rfc822 format available.

Message #8 received at 51092 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Evan Klitzke <evan <at> eklitzke.org>
Cc: 51092 <at> debbugs.gnu.org, Alan Mackenzie <acm <at> muc.de>
Subject: Re: bug#51092: [PATCH] Recognize consteval and constinit modifiers
 in C++
Date: Fri, 08 Oct 2021 13:02:02 +0200
Evan Klitzke <evan <at> eklitzke.org> writes:

> These two modifiers were introduced by C++20. The change is trivial
> but I tested it locally on some code I have that uses these modifiers
> and with this change the keywords are recognized as expected. I agree
> to copyright assignment to the FSF, etc. Patch against master is
> attached; I think this should be backported to the emacs-28 branch as
> well.

[...]

> -  c++  (append '("constexpr" "explicit" "friend" "mutable" "template"
> -		 "thread_local" "virtual")
> +  c++  (append '("consteval" "constexpr" "constinit" "explicit"
> +		 "friend" "mutable" "template" "thread_local" "virtual")

Makes sense to me; perhaps Alan has some comments, so I've added him to
the CCs.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51092; Package emacs. (Tue, 12 Oct 2021 10:55:01 GMT) Full text and rfc822 format available.

Message #11 received at 51092 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 51092 <at> debbugs.gnu.org, acm <at> muc.de, Evan Klitzke <evan <at> eklitzke.org>
Subject: Re: bug#51092: [PATCH] Recognize consteval and constinit modifiers
 in C++
Date: Tue, 12 Oct 2021 10:54:00 +0000
Hello, Evan and Lars.

On Fri, Oct 08, 2021 at 13:02:02 +0200, Lars Ingebrigtsen wrote:
> Evan Klitzke <evan <at> eklitzke.org> writes:

> > These two modifiers were introduced by C++20. The change is trivial
> > but I tested it locally on some code I have that uses these modifiers
> > and with this change the keywords are recognized as expected. I agree
> > to copyright assignment to the FSF, etc. Patch against master is
> > attached; I think this should be backported to the emacs-28 branch as
> > well.

> [...]

> > -  c++  (append '("constexpr" "explicit" "friend" "mutable" "template"
> > -		 "thread_local" "virtual")
> > +  c++  (append '("consteval" "constexpr" "constinit" "explicit"
> > +		 "friend" "mutable" "template" "thread_local" "virtual")

> Makes sense to me; perhaps Alan has some comments, so I've added him to
> the CCs.

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.

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. 

The copyright assignments are a bit of a hassle.  I think they've still
got to be done on paper.  But for just the patch you've proposed, an
assignment wouldn't be needed.  Richard Stallman has confirmed that the
measure is the number of lines of code added/changed, not the degree of
functionality.  Lars is probably better informed than me about this, and
Eli Zaretskii certainly is.

> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51092; Package emacs. (Tue, 12 Oct 2021 14:15:02 GMT) Full text and rfc822 format available.

Message #14 received at 51092 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 51092 <at> debbugs.gnu.org, acm <at> muc.de, larsi <at> gnus.org, evan <at> eklitzke.org
Subject: Re: bug#51092: [PATCH] Recognize consteval and constinit modifiers in
 C++
Date: Tue, 12 Oct 2021 17:13:37 +0300
> Date: Tue, 12 Oct 2021 10:54:00 +0000
> From: Alan Mackenzie <acm <at> muc.de>
> Cc: 51092 <at> debbugs.gnu.org, acm <at> muc.de, Evan Klitzke <evan <at> eklitzke.org>
> 
> The copyright assignments are a bit of a hassle.  I think they've still
> got to be done on paper.

No, not anymore.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51092; Package emacs. (Thu, 14 Oct 2021 18:23:02 GMT) Full text and rfc822 format available.

Message #17 received at 51092 <at> debbugs.gnu.org (full text, mbox):

From: Evan Klitzke <evan <at> eklitzke.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 51092 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#51092: [PATCH] Recognize consteval and constinit modifiers in
 C++
Date: Thu, 14 Oct 2021 14:22:22 -0400
On Tue, Oct 12, 2021 at 6:54 AM Alan Mackenzie <acm <at> muc.de> 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/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51092; Package emacs. (Sat, 10 Sep 2022 05:20:01 GMT) Full text and rfc822 format available.

Message #20 received at 51092 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 51092 <at> debbugs.gnu.org, Evan Klitzke <evan <at> eklitzke.org>
Subject: Re: bug#51092: [PATCH] Recognize consteval and constinit modifiers
 in C++
Date: Sat, 10 Sep 2022 07:19:04 +0200
Alan Mackenzie <acm <at> muc.de> writes:

>> > -  c++  (append '("constexpr" "explicit" "friend" "mutable" "template"
>> > -		 "thread_local" "virtual")
>> > +  c++  (append '("consteval" "constexpr" "constinit" "explicit"
>> > +		 "friend" "mutable" "template" "thread_local" "virtual")
>
>> Makes sense to me; perhaps Alan has some comments, so I've added him to
>> the CCs.
>
> 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.

There wasn't much followup here.  Alan, isn't the proposed patch a step
in the right direction anyway, even if it doesn't add full C++20
support?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51092; Package emacs. (Tue, 13 Sep 2022 17:27:02 GMT) Full text and rfc822 format available.

Message #23 received at 51092 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 51092 <at> debbugs.gnu.org, acm <at> muc.de, Evan Klitzke <evan <at> eklitzke.org>
Subject: Re: bug#51092: [PATCH] Recognize consteval and constinit modifiers
 in C++
Date: Tue, 13 Sep 2022 17:26:25 +0000
Hello, Lars and Evan.

On Sat, Sep 10, 2022 at 07:19:04 +0200, Lars Ingebrigtsen wrote:
> Alan Mackenzie <acm <at> muc.de> writes:

> >> > -  c++  (append '("constexpr" "explicit" "friend" "mutable" "template"
> >> > -		 "thread_local" "virtual")
> >> > +  c++  (append '("consteval" "constexpr" "constinit" "explicit"
> >> > +		 "friend" "mutable" "template" "thread_local" "virtual")

> >> Makes sense to me; perhaps Alan has some comments, so I've added him to
> >> the CCs.

> > 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.

> There wasn't much followup here.

Sorry, I think that was my fault.

> Alan, isn't the proposed patch a step in the right direction anyway,
> even if it doesn't add full C++20 support?

Yes, I think it's time to apply the patch.  It would have been a year
ago, too.  Are you (Lars) going to apply it, or should I?

Just as a matter of interest, I'm working on C++20 stuff at the moment,
and have an almost ready implementation of module/import/export.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51092; Package emacs. (Wed, 14 Sep 2022 12:34:01 GMT) Full text and rfc822 format available.

Message #26 received at 51092 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 51092 <at> debbugs.gnu.org, Evan Klitzke <evan <at> eklitzke.org>
Subject: Re: bug#51092: [PATCH] Recognize consteval and constinit modifiers
 in C++
Date: Wed, 14 Sep 2022 14:32:56 +0200
Alan Mackenzie <acm <at> muc.de> writes:

> Yes, I think it's time to apply the patch.  It would have been a year
> ago, too.  Are you (Lars) going to apply it, or should I?

I've now pushed the patch to Emacs 29.

> Just as a matter of interest, I'm working on C++20 stuff at the moment,
> and have an almost ready implementation of module/import/export.

Great!




bug marked as fixed in version 29.1, send any further explanations to 51092 <at> debbugs.gnu.org and Evan Klitzke <evan <at> eklitzke.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 14 Sep 2022 12:34:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 Oct 2022 11:24:16 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 196 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.