From unknown Fri Jun 20 07:11:19 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#45560 <45560@debbugs.gnu.org> To: bug#45560 <45560@debbugs.gnu.org> Subject: Status: 27.1; add-change-log-entry erroneously removes "const" from function name Reply-To: bug#45560 <45560@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:11:19 +0000 retitle 45560 27.1; add-change-log-entry erroneously removes "const" from f= unction name reassign 45560 emacs submitter 45560 Tom Tromey severity 45560 normal tag 45560 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 30 18:12:26 2020 Received: (at submit) by debbugs.gnu.org; 30 Dec 2020 23:12:26 +0000 Received: from localhost ([127.0.0.1]:51466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kukdl-0001so-R5 for submit@debbugs.gnu.org; Wed, 30 Dec 2020 18:12:26 -0500 Received: from lists.gnu.org ([209.51.188.17]:57550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kukdk-0001sh-2d for submit@debbugs.gnu.org; Wed, 30 Dec 2020 18:12:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kukdj-0002vI-TU for bug-gnu-emacs@gnu.org; Wed, 30 Dec 2020 18:12:23 -0500 Received: from gateway34.websitewelcome.com ([192.185.148.204]:35312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kukdg-0003i3-N4 for bug-gnu-emacs@gnu.org; Wed, 30 Dec 2020 18:12:22 -0500 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 374E110F2F0 for ; Wed, 30 Dec 2020 17:11:43 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id ukd5kU3NOiQiZukd5kBjDM; Wed, 30 Dec 2020 17:11:43 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=nJftIUA97Ar9jJpjtmtIEEEaiPIgsukwymqFTF2evhU=; b=PFq28JdgJtvvs+6q9VgtYX7bfP gguCtJQ+mbxwu99fUqlxG5bIw24lHA8mnYUqryrwqIxaO6j5fAod0k1pDaR6+wgwiuaI4mfD86pyX 8+AsJ7UVySqcKndHHOEhAbaxv; Received: from 97-122-81-39.hlrn.qwest.net ([97.122.81.39]:55948 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kukd4-004NuI-T0; Wed, 30 Dec 2020 16:11:43 -0700 From: Tom Tromey To: bug-gnu-emacs@gnu.org Subject: 27.1; add-change-log-entry erroneously removes "const" from function name X-Attribution: Tom Date: Wed, 30 Dec 2020 16:11:41 -0700 Message-ID: <87im8ievo2.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.81.39 X-Source-L: No X-Exim-ID: 1kukd4-004NuI-T0 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-81-39.hlrn.qwest.net (localhost.localdomain) [97.122.81.39]:55948 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes Received-SPF: permerror client-ip=192.185.148.204; envelope-from=tom@tromey.com; helo=gateway34.websitewelcome.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Put this into a .c file: void const_ref () { } Now, put point inside the braces and M-x add-change-log-entry. For me the resulting ChangeLog looks like: 2020-12-30 Tom Tromey * q.c (_ref):=20 Note that the "const" was removed. However, it should not be removed here, as it is part of the function's name. In GNU Emacs 27.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.21, = cairo version 1.16.0) of 2020-08-20 built on buildvm-x86-24.iad2.fedoraproject.org Windowing system distributor 'Fedora Project', version 11.0.12010000 System Description: Fedora 32 (Workstation Edition) Recent messages: Saving file /tmp/q.c... Wrote /tmp/q.c Quit C-c a runs the command tromey-add-change-log-entry Undo [3 times] Redo [2 times] C-x C-g is undefined Quit Scanning for dabbrevs...done user-error: No dynamic expansion for =E2=80=98add-changelo=E2=80=99 found Configured using: 'configure --build=3Dx86_64-redhat-linux-gnu --host=3Dx86_64-redhat-linux-gnu --program-prefix=3D --disable-dependency-tracking --prefix=3D/usr --exec-prefix=3D/usr --bindir=3D/usr/bin --sbindir=3D/usr/sbin --sysconfdir=3D/etc --datadir=3D/usr/share --includedir=3D/usr/include --libdir=3D/usr/lib64 --libexecdir=3D/usr/libexec --localstatedir=3D/var --sharedstatedir=3D/var/lib --mandir=3D/usr/share/man --infodir=3D/usr/share/info --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=3Dgtk3 --with-gpm=3Dno --with-xwidgets --with-modules --with-harfbuzz --with-cairo --with-json build_alias=3Dx86_64-redhat-linux-gnu host_alias=3Dx86_64-redhat-linux-gnu 'CFLAGS=3D-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=3Dformat-security -Wp,-D_FORTIFY_SOURCE=3D2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' LDFLAGS=3D-Wl,-z,relro PKG_CONFIG_PATH=3D:/usr/lib64/pkgconfig:/usr/share/pkgconfig' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD JSON PDUMPER GMP Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix Major mode: Change Log Minor modes in effect: flyspell-mode: t shell-dirtrack-mode: t which-function-mode: t erc-services-mode: t erc-networks-mode: t savehist-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t auto-fill-function: do-auto-fill transient-mark-mode: t Load-path shadows: /home/tromey/.emacs.d/elpa/bubbles-0.5/bubbles hides /usr/share/emacs/27.1/= lisp/play/bubbles Features: (shadow mail-hist emacsbug flow-fill tcl shr-color mm-archive sh-script smie executable rect copyright dabbrev goto-addr ggtags hippie-exp etags fileloop generator xref project bug-reference smerge-mode diff cc-mode cc-fonts cc-guess cc-menus cc-cmds term/xterm xterm apropos mule-diag descr-text sort smiley gnus-cite mail-extr gnus-bcklg gnus-async qp gnus-ml disp-table gnus-topic nndraft nnmh nnfolder utf-7 gnutls network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp gnus-cache gnus-sum url url-proxy url-privacy url-expand url-methods url-history mailcap shr url-cookie url-domsuf url-util svg xml dom gnus-group gnus-undo smtpmail sendmail gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums text-property-search mail-utils mm-util mail-prsvr two-column iso-transl help-fns radix-tree log-view pcvs-util vc-mtn vc-hg cl-extra help-mode vc-git diff-mode vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs misearch multi-isearch add-log flyspell ispell diminish projectile ibuf-macs pcase edmacro kmacro grep compile ibuf-ext ibuffer ibuffer-loaddefs dash appt diary-lib diary-loaddefs cal-menu calendar cal-loaddefs tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat shell pcomplete parse-time iso8601 time-date ls-lisp which-func imenu minimap autorevert filenotify cus-start cus-load erc-track erc-match erc-services erc-networks erc-hl-nicks easy-mmode color erc-button erc-fill erc-stamp wid-edit erc-goodies erc erc-backend erc-compat format-spec thingatpt pp erc-loaddefs warnings advice vc-dir ewoc vc vc-dispatcher cc-styles cc-align cc-engine cc-vars cc-defs ange-ftp comint ansi-color ring server savehist finder-inf gdb-shell-autoloads lisppaste-autoloads pydoc-info-autoloads info-look info cl weblogger-autoloads package easymenu browse-url url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting xwidget-internal cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 1344143 98632) (symbols 48 71080 17) (strings 32 190276 19842) (string-bytes 1 6368664) (vectors 16 83075) (vector-slots 8 2440137 207780) (floats 8 448 669) (intervals 56 185659 164) (buffers 1000 464)) From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 31 00:09:35 2020 Received: (at 45560) by debbugs.gnu.org; 31 Dec 2020 05:09:35 +0000 Received: from localhost ([127.0.0.1]:51683 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kuqDP-00068m-0N for submit@debbugs.gnu.org; Thu, 31 Dec 2020 00:09:35 -0500 Received: from quimby.gnus.org ([95.216.78.240]:44592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kuqDM-00068X-UJ for 45560@debbugs.gnu.org; Thu, 31 Dec 2020 00:09:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JYhsNwnNMgfVIMxzm4xx1SvcUTr5x2LE89eM2pODaIM=; b=M8MotuD51otRXAPyDSD1ORSm+P g07QrCgSyUyElUZgUH2Ty+OughqAXdZ9ilggsN+yzNGAEKGvIRYGOgSGTx2Hkks4p4WtCyTUt2OeR Op9RwDTXxDvQXT28aCv5vupFqEfXca0bt9+Aifi6IQiHlyrJWZYOdO5R3hkuwzAbA+5M=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kuqDC-0002af-N3; Thu, 31 Dec 2020 06:09:26 +0100 From: Lars Ingebrigtsen To: Tom Tromey Subject: Re: bug#45560: 27.1; add-change-log-entry erroneously removes "const" from function name References: <87im8ievo2.fsf@tromey.com> X-Now-Playing: Hermine's _The World On My Plates_: "I Won't Make It Without You" Date: Thu, 31 Dec 2020 06:09:21 +0100 In-Reply-To: <87im8ievo2.fsf@tromey.com> (Tom Tromey's message of "Wed, 30 Dec 2020 16:11:41 -0700") Message-ID: <87ft3mmuim.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Tom Tromey writes: > Put this into a .c file: > > void > const_ref () > { > } > > Now, put point inside the braces and M-x add-change-log-entry. > > For me the resulting ChangeLog looks like: > > 2020-12-30 Tom Tromey < [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 45560 Cc: Alan Mackenzie , 45560@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Tom Tromey writes: > Put this into a .c file: > > void > const_ref () > { > } > > Now, put point inside the braces and M-x add-change-log-entry. > > For me the resulting ChangeLog looks like: > > 2020-12-30 Tom Tromey > > * q.c (_ref): Debugging this, it looks like this is down to (c-defun-name-1) returning "_ref" if called in the const_ref function, so I've added Alan to the CCs. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 01 11:20:36 2021 Received: (at 45560) by debbugs.gnu.org; 1 Jan 2021 16:20:36 +0000 Received: from localhost ([127.0.0.1]:34594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvNAJ-0006fH-Jg for submit@debbugs.gnu.org; Fri, 01 Jan 2021 11:20:36 -0500 Received: from colin.muc.de ([193.149.48.1]:56558 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1kvNAH-0006f0-18 for 45560@debbugs.gnu.org; Fri, 01 Jan 2021 11:20:34 -0500 Received: (qmail 41631 invoked by uid 3782); 1 Jan 2021 16:20:26 -0000 Received: from acm.muc.de (p4fe15b14.dip0.t-ipconnect.de [79.225.91.20]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 01 Jan 2021 17:20:25 +0100 Received: (qmail 8265 invoked by uid 1000); 1 Jan 2021 16:20:25 -0000 Date: Fri, 1 Jan 2021 16:20:25 +0000 To: Lars Ingebrigtsen , Tom Tromey Subject: Re: bug#45560: 27.1; add-change-log-entry erroneously removes "const" from function name Message-ID: References: <87im8ievo2.fsf@tromey.com> <87ft3mmuim.fsf@gnus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ft3mmuim.fsf@gnus.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 45560 Cc: acm@muc.de, 45560@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Lars and Tom On Thu, Dec 31, 2020 at 06:09:21 +0100, Lars Ingebrigtsen wrote: > Tom Tromey writes: > > Put this into a .c file: > > > > void > > const_ref () > > { > > } > > > > Now, put point inside the braces and M-x add-change-log-entry. > > > > For me the resulting ChangeLog looks like: > > > > 2020-12-30 Tom Tromey > > > > * q.c (_ref): > Debugging this, it looks like this is down to > (c-defun-name-1) > returning "_ref" if called in the const_ref function, so I've added Alan > to the CCs. Yes, there was a regular expression recognising "const" where it shouldn't have. It was a regexp with many discordant, conflicting requirements, so I had to "split it in two" to get it working properly. Please try the following patch out, which shouldn't be at all controversial, and let me know whether it fixes everything. Thanks! diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 7444f0f805..60e85fc085 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -9021,14 +9021,15 @@ c-forward-declarator (c-forward-noise-clause)) ((and (looking-at c-type-decl-prefix-key) (if (and (c-major-mode-is 'c++-mode) - (match-beginning 3)) + (match-beginning 4)) ; Was 3 - 2021-01-01 ;; If the third submatch matches in C++ then ;; we're looking at an identifier that's a ;; prefix only if it specifies a member pointer. (progn (setq id-start (point)) (c-forward-name) - (if (looking-at "\\(::\\)") + (if (save-match-data + (looking-at "\\(::\\)")) ;; We only check for a trailing "::" and ;; let the "*" that should follow be ;; matched in the next round. @@ -9038,13 +9039,15 @@ c-forward-declarator (setq got-identifier t) nil)) t)) - (if (looking-at c-type-decl-operator-prefix-key) + (if (save-match-data + (looking-at c-type-decl-operator-prefix-key)) (setq decorated t)) (if (eq (char-after) ?\() (progn (setq paren-depth (1+ paren-depth)) (forward-char)) - (goto-char (match-end 1))) + (goto-char (or (match-end 1) + (match-end 2)))) (c-forward-syntactic-ws) t))) @@ -9721,14 +9724,15 @@ c-forward-decl-or-cast-1 (setq after-paren-pos (point)))) (while (and (looking-at c-type-decl-prefix-key) (if (and (c-major-mode-is 'c++-mode) - (match-beginning 3)) + (match-beginning 4)) ;; If the third submatch matches in C++ then ;; we're looking at an identifier that's a ;; prefix only if it specifies a member pointer. (when (progn (setq pos (point)) (setq got-identifier (c-forward-name))) (setq name-start pos) - (if (looking-at "\\(::\\)") + (if (save-match-data + (looking-at "\\(::\\)")) ;; We only check for a trailing "::" and ;; let the "*" that should follow be ;; matched in the next round. @@ -9749,7 +9753,8 @@ c-forward-decl-or-cast-1 (when (save-match-data (looking-at c-type-decl-operator-prefix-key)) (setq got-function-name-prefix t)) - (goto-char (match-end 1))) + (goto-char (or (match-end 1) + (match-end 2)))) (c-forward-syntactic-ws))) (setq got-parens (> paren-depth 0)) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index c3cd81e1e8..9577f55e87 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -3433,41 +3433,47 @@ c-populate-syntax-table t (c-make-bare-char-alt (c-lang-const c-block-prefix-disallowed-chars) t)) (c-lang-defvar c-block-prefix-charset (c-lang-const c-block-prefix-charset)) -(c-lang-defconst c-type-decl-prefix-key - "Regexp matching any declarator operator that might precede the -identifier in a declaration, e.g. the \"*\" in \"char *argv\". This -regexp should match \"(\" if parentheses are valid in declarators. -The end of the first submatch is taken as the end of the operator. -Identifier syntax is in effect when this is matched (see -`c-identifier-syntax-table')." +(c-lang-defconst c-type-decl-prefix-keywords-key + ;; Regexp matching any keyword operator that might precede the identifier in + ;; a declaration, e.g. "const" or nil. It doesn't test there is no "_" + ;; following the keyword. t (if (or (c-lang-const c-type-modifier-kwds) (c-lang-const c-modifier-kwds)) - (concat + (concat (regexp-opt (c--delete-duplicates (append (c-lang-const c-type-modifier-kwds) (c-lang-const c-modifier-kwds)) :test 'string-equal) t) - "\\>") - ;; Default to a regexp that never matches. - regexp-unmatchable) + "\\>"))) + +(c-lang-defconst c-type-decl-prefix-key + "Regexp matching any declarator operator that might precede the +identifier in a declaration, e.g. the \"*\" in \"char *argv\". This +regexp should match \"(\" if parentheses are valid in declarators. +The operator found is either the first submatch (if it is not a +keyword) or the second submatch (if it is)." + t (if (c-lang-const c-type-decl-prefix-keywords-key) + (concat "\\(\\`a\\`\\)\\|" ; 1 - will never match. + (c-lang-const c-type-decl-prefix-keywords-key) ; 2 + "\\([^_]\\|$\\)") ; 3 + regexp-unmatchable) ;; Default to a regexp that never matches. ;; Check that there's no "=" afterwards to avoid matching tokens ;; like "*=". - (c objc) (concat "\\(" + (c objc) (concat "\\(" ; 1 "[*(]" - "\\|" - (c-lang-const c-type-decl-prefix-key) - "\\)" - "\\([^=]\\|$\\)") - c++ (concat "\\(" + "\\)\\|" + (c-lang-const c-type-decl-prefix-keywords-key) ; 2 + "\\([^=_]\\|$\\)") ; 3 + c++ (concat "\\(" ; 1 "&&" "\\|" "\\.\\.\\." "\\|" "[*(&~]" + "\\)\\|\\(" ; 2 + (c-lang-const c-type-decl-prefix-keywords-key) ; 3 "\\|" - (c-lang-const c-type-decl-prefix-key) - "\\|" - (concat "\\(" ; 3 + (concat "\\(" ; 4 ;; If this matches there's special treatment in ;; `c-font-lock-declarators' and ;; `c-font-lock-declarations' that check for a @@ -3475,8 +3481,9 @@ c-populate-syntax-table (c-lang-const c-identifier-start) "\\)") "\\)" - "\\([^=]\\|$\\)") + "\\([^=_]\\|$\\)") ; 5 pike "\\(\\*\\)\\([^=]\\|$\\)") + (c-lang-defvar c-type-decl-prefix-key (c-lang-const c-type-decl-prefix-key) 'dont-doc) > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 02 00:42:20 2021 Received: (at 45560) by debbugs.gnu.org; 2 Jan 2021 05:42:20 +0000 Received: from localhost ([127.0.0.1]:38882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvZgC-0000bI-9I for submit@debbugs.gnu.org; Sat, 02 Jan 2021 00:42:20 -0500 Received: from quimby.gnus.org ([95.216.78.240]:35642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvZgA-0000b4-Qx for 45560@debbugs.gnu.org; Sat, 02 Jan 2021 00:42:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=R/3k8Wt4SpXX7x5034kS9FBt/0CSOjcQHqLL92fuaiU=; b=i8ERXXl95LSFBXSU1UPePeobO1 Rr9ox2EHrAzdYzgG46nfq16l9/rmFdo3/oQ3rVs8rZ3lz/jG8LUy9iltSirllMSQshiXti2PWsqVX tU/U5Yiwml377YYye15m1GtPjp+hbv8ZPHXgyu4846fPVAPoss2vaPYyNFe9b0OQGkFI=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kvZg1-0006eL-9P; Sat, 02 Jan 2021 06:42:11 +0100 From: Lars Ingebrigtsen To: Alan Mackenzie Subject: Re: bug#45560: 27.1; add-change-log-entry erroneously removes "const" from function name References: <87im8ievo2.fsf@tromey.com> <87ft3mmuim.fsf@gnus.org> X-Now-Playing: Simple Minds's _Sparkle In The Rain_: "White Hot Day" Date: Sat, 02 Jan 2021 06:42:07 +0100 In-Reply-To: (Alan Mackenzie's message of "Fri, 1 Jan 2021 16:20:25 +0000") Message-ID: <87h7nzao9c.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Alan Mackenzie writes: > Please try the following patch out, which shouldn't be at all > controversial, and let me know whether it fixes everything. Thanks! Yup; your patch fixes the test case here, too. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 45560 Cc: Tom Tromey , 45560@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > Please try the following patch out, which shouldn't be at all > controversial, and let me know whether it fixes everything. Thanks! Yup; your patch fixes the test case here, too. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 11 10:49:59 2021 Received: (at control) by debbugs.gnu.org; 11 Jan 2021 15:49:59 +0000 Received: from localhost ([127.0.0.1]:57953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyzSB-0001kt-Jw for submit@debbugs.gnu.org; Mon, 11 Jan 2021 10:49:59 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyzSA-0001ka-1S for control@debbugs.gnu.org; Mon, 11 Jan 2021 10:49:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=MNx1NVFmfX5wDXznG2Eqqpv/9+5uyLp7AYdNF6vaiBE=; b=SfL81LJI8DaKlF1VcIRCksXZ0y 5LNlhwR+dshXmyXcF7ub1gftuoTQwcAZNdOJS7UFrg1A3dMDmxylOMWL071BPdqxXpQge+pvJerJc 5mrwzDtAm05Y32WH7hfee/xmcH6OqqagwclBi34vf3Qz2yvDABU+5JIbjt7lr0MVqUBw=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kyzS2-00007i-Cc for control@debbugs.gnu.org; Mon, 11 Jan 2021 16:49:52 +0100 Date: Mon, 11 Jan 2021 16:49:49 +0100 Message-Id: <874kjnfp7m.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #45560 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 45560 + patch quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 45560 + patch quit From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 02 15:42:19 2021 Received: (at 45560-done) by debbugs.gnu.org; 2 Feb 2021 20:42:19 +0000 Received: from localhost ([127.0.0.1]:36261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l72V9-00035L-IW for submit@debbugs.gnu.org; Tue, 02 Feb 2021 15:42:19 -0500 Received: from colin.muc.de ([193.149.48.1]:52607 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1l72V4-000353-Og for 45560-done@debbugs.gnu.org; Tue, 02 Feb 2021 15:42:17 -0500 Received: (qmail 2899 invoked by uid 3782); 2 Feb 2021 20:42:08 -0000 Received: from acm.muc.de (p4fe157c0.dip0.t-ipconnect.de [79.225.87.192]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 02 Feb 2021 21:42:07 +0100 Received: (qmail 2067 invoked by uid 1000); 2 Feb 2021 20:42:07 -0000 Date: Tue, 2 Feb 2021 20:42:07 +0000 To: Lars Ingebrigtsen , Tom Tromey Subject: Re: bug#45560: 27.1; add-change-log-entry erroneously removes "const" from function name Message-ID: References: <87im8ievo2.fsf@tromey.com> <87ft3mmuim.fsf@gnus.org> <87h7nzao9c.fsf@gnus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87h7nzao9c.fsf@gnus.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 45560-done Cc: 45560-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Lars and Tom. On Sat, Jan 02, 2021 at 06:42:07 +0100, Lars Ingebrigtsen wrote: > Alan Mackenzie writes: > > Please try the following patch out, which shouldn't be at all > > controversial, and let me know whether it fixes everything. Thanks! > Yup; your patch fixes the test case here, too. Thanks! I've committed the patch, and I'm closing the bug with this post. > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany). From unknown Fri Jun 20 07:11:19 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 03 Mar 2021 12:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator