From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Martin Stiaszny Newsgroups: gmane.emacs.bugs Subject: bug#44607: 27.1; c++ keyword "final" causes etags to fail to generate tags for that class and its members Date: Thu, 12 Nov 2020 12:21:41 -0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000093c49b05b3eea93c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27199"; mail-complaints-to="usenet@ciao.gmane.io" To: 44607@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 13 01:31:11 2020 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 1kdMzf-0006zj-FN for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Nov 2020 01:31:11 +0100 Original-Received: from localhost ([::1]:59230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdMze-0008Fg-Fx for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Nov 2020 19:31:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdMzW-0008FS-QO for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 19:31:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34578) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kdMzW-0006gy-H2 for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 19:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kdMzW-0005Xu-Ej for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 19:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Martin Stiaszny Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Nov 2020 00:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44607 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160522741318258 (code B ref -1); Fri, 13 Nov 2020 00:31:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Nov 2020 00:30:13 +0000 Original-Received: from localhost ([127.0.0.1]:46123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdMyh-0004jW-Nx for submit@debbugs.gnu.org; Thu, 12 Nov 2020 19:30:12 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:59874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdJ6W-0004nH-Or for submit@debbugs.gnu.org; Thu, 12 Nov 2020 15:22:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdJ6V-0004Oe-04 for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 15:22:00 -0500 Original-Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]:38169) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kdJ6R-0001R6-M1 for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 15:21:58 -0500 Original-Received: by mail-lf1-x136.google.com with SMTP id 74so10388994lfo.5 for ; Thu, 12 Nov 2020 12:21:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=K0u2qRECvgKHRzMtMkVI8lBrSLnGOz+ywGoLLe1oxtk=; b=F74A8i15BFKSABx77DURWsXZNlwgT4g0n4YypQm9xgiEOb37w8aI5Dpvupqqs4wltF iRtLwMTl2HiPw20p3G5G2vDmIxo99dXwUyn+4gl7btjsrbHk0jERIyu1Vsv/jOSBMdM8 X4YoJOm4BM1k12CJQ7hNDa8I0j498fh07msgiITObtbU5I1keg0jAyIFPyl070MNlbae hnA/LvxNTuuYJHzRV958ygs3NK1+qovdQljuyPnPg605nSiWaliP6LzzjLQHHkJsH+ve aEWEj+ZzIEct91gdzVCicL3cfnVt1xElKZBEOQKdBTdP32Ik4KToofhlLZQDnukVukK4 dkWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=K0u2qRECvgKHRzMtMkVI8lBrSLnGOz+ywGoLLe1oxtk=; b=QX4E1mKMca8ffjRXmGfhZkkUfw7e/cYl3ULjvsQO72YuSDQx3fXjYS/zz8qwyLzoA6 IZB3OOuByAls4vcVhoBCBJ2dOiw0yrJaz3llTFD1KLr++8PVUkghPFM1qMfFVApwxzIO NX3DTMjajDvDrQ8rPHasPU1HjkabQfJceRBmt9tGG7xRFuzCYC4+oc+B/nUjIB4SDT2N tGXBD5ZKVD40ecoU0rjtSbs9vi6Q/Bz9++L37gIYgIFQPud8K+0J6Mmgo9ElCFMD3uEn SIg6Oo+fkaTYVkHrTyoaar43Qk8vM3sqMHY90tD4fJ0zyD9158b/SI6CaqkDutwnE+2d 40LA== X-Gm-Message-State: AOAM532KchWVKbLFNc/fV3t6yXuK09GHO2IIVhn9SURVefL8DmRUa/Ba Iw81CsN2baNPuBEW7jmrQhPBlCSH8nxRCIv8swEDj07xCy0= X-Google-Smtp-Source: ABdhPJzm7dII/iwUE4iNq+3+AtYCsVemD/zjpc3KUcY+hPTf6+1GQWTdQF2oqOcUMena/YzDeLnoeb6xoOcSpxYJKZg= X-Received: by 2002:ac2:5446:: with SMTP id d6mr475606lfn.271.1605212512173; Thu, 12 Nov 2020 12:21:52 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=stiaszny@gmail.com; helo=mail-lf1-x136.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 12 Nov 2020 19:30:10 -0500 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:193197 Archived-At: --00000000000093c49b05b3eea93c Content-Type: text/plain; charset="UTF-8" command: etags --declarations --language=c++ base.h child.h base.h: class base { int bar; } child.h: class child final : public base { int foo; } TAGS file: base.h,32 class base 1,0 int bar;2,13 child.h,0 If I delete the "final" keyword from child.h, as such: class child : public base { int foo; } The tags are generated correctly: mstiaszny@5057-desktop:~/src/etags-test$ cat TAGS base.h,32 class base 1,0 int bar;2,13 child.h,33 class child 1,0 int foo;2,28 I did some step-through debugging and created this patch that does indeed allow tags to be generated for final classes: mstiaszny@5057-desktop:~/src/emacs/emacs-27.1/lib-src$ diff etags.c etags.c.orig 3733,3735d3732 < else if (structdef == stagseen && !cjava && (strncmp(lp - 1, "final", 5) == 0)) { < lp += 4; < } However, that is almost certainly not the correct way to fix this; this is only here to be a guide for the maintainer. Bug #43203 - https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43203 maybe be a symptom of the same underlying issue. --- info from M-x report-emacs-bug; probably not relevant, since this is an etags problem --- In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.23) of 2020-10-26 built on 5057-desktop System Description: Ubuntu 14.04.6 LTS Configured features: XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11 XDBE XIM MODULES THREADS PDUMPER Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Info Minor modes in effect: 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 buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow emacsbug sendmail novice sort gnus-cite shr-color color mail-extr gnus-async gnus-bcklg qp gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-ml gnus-msg disp-table nndoc gnus-cache gnus-dup gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum shr svg dom gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int gnus-range gnus-win gnus nnheader crm org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob-core ob-eval org-table ol org-keys org-compat advice org-macs org-loaddefs find-func cal-menu calendar cal-loaddefs debbugs-gnu pcase edmacro kmacro add-log debbugs soap-client warnings rng-xsd rng-dt rng-util xsd-regexp xml compile comint ansi-color ring autoload radix-tree tar-mode arc-mode archive-mode cus-edit cus-start cus-load wid-edit cl-extra mm-archive message dired dired-loaddefs format-spec rfc822 mml mml-sec epa derived gnus-util rmail rmail-loaddefs text-property-search time-date mailabbrev gmm-utils mailheader mm-decode mm-bodies mm-encode mail-utils lisp-mnt help-mode gnutls network-stream url-http mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm rmc puny url-cache url-auth url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap epg epg-config misearch multi-isearch mule-util jka-compr info vc-git diff-mode easy-mmode term/xterm xterm finder-inf rx 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 move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 557294 194503) (symbols 48 24597 2) (strings 32 127018 26928) (string-bytes 1 3504683) (vectors 16 33787) (vector-slots 8 406071 52780) (floats 8 6497 1337) (intervals 56 5924 5924) (buffers 1000 37) (heap 1024 30911 9014)) --00000000000093c49b05b3eea93c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
command:
etags --declarations --language=3Dc++ base.h = child.h

base.h:=C2=A0
class base {=C2=A0 int bar;
}

child.h:
clas= s child final : public base {
=C2=A0 int foo;
}

TAGS file:

base.h,32
class base 1,0
=C2=A0 int = bar;2,13


child.h,0

If I delete the = "final" keyword from child.h, as such:

c= lass child : public base {
=C2=A0 int foo;
}

=
The tags are generated=C2=A0correctly:
mstiaszny@5057-deskto= p:~/src/etags-test$ cat TAGS


base.h,32
class base 1,0
=C2= =A0 int bar;2,13


child.h,33
class child 1,0
=C2=A0 int foo= ;2,28

I did some step-through debugging and cr= eated this patch that does indeed allow tags to be generated for final clas= ses:

mstiaszny@5057-desktop:~/src/emacs/emacs-27.1= /lib-src$ diff etags.c etags.c.orig
3733,3735d3732
< =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 else if (structdef =3D=3D stagseen && !cja= va && (strncmp(lp - 1, "final", 5) =3D=3D 0)) {
< = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 lp +=3D 4;
< =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 }

However, that is almost= certainly not the correct way to fix this; this is only here to be a guide= for the maintainer.=C2=A0 Bug #43203 -=C2=A0https://debbugs.gnu.org/cgi/bugreport.c= gi?bug=3D43203 maybe be a symptom of the same underlying issue.

--- info from M-x report-emacs-bug; probably not relevant= , since this is an etags problem ---

In GNU Emacs = 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.23)
=C2=A0of 2020-= 10-26 built on 5057-desktop
System Description: Ubuntu 14.04.6 LTS

Configured features:
XPM JPEG TIFF GIF PNG SOUND= DBUS GSETTINGS GLIB NOTIFY INOTIFY GNUTLS
LIBXML2 FREETYPE XFT ZLIB TOO= LKIT_SCROLL_BARS GTK2 X11 XDBE XIM MODULES
THREADS PDUMPER

Import= ant settings:
=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 locale-coding= -system: utf-8-unix

Major mode: Info

Minor modes in effect:=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 electric-= indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 file-name-shadow-mod= e: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2= =A0 auto-composition-mode: t
=C2=A0 auto-encryption-mode: t
=C2=A0 au= to-compression-mode: t
=C2=A0 buffer-read-only: t
=C2=A0 column-numbe= r-mode: t
=C2=A0 line-number-mode: t
=C2=A0 transient-mark-mode: t
Load-path shadows:
None found.

Features:
(shad= ow emacsbug sendmail novice sort gnus-cite shr-color color
mail-extr gnu= s-async gnus-bcklg qp gnus-agent gnus-srvr gnus-score
score-mode nnvirtu= al nntp gnus-ml gnus-msg disp-table nndoc gnus-cache
gnus-dup gnus-art m= m-uu mml2015 mm-view mml-smime smime dig gnus-sum shr
svg dom gnus-group= gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source utf7 netrc nn= oo parse-time iso8601 gnus-spec gnus-int
gnus-range gnus-win gnus nnhead= er crm org ob ob-tangle ob-ref ob-lob
ob-table ob-exp org-macro org-foot= note org-src ob-comint org-pcomplete
pcomplete org-list org-faces org-en= tities noutline outline org-version
ob-emacs-lisp ob-core ob-eval org-ta= ble ol org-keys org-compat advice
org-macs org-loaddefs find-func cal-me= nu calendar cal-loaddefs
debbugs-gnu pcase edmacro kmacro add-log debbug= s soap-client warnings
rng-xsd rng-dt rng-util xsd-regexp xml compile co= mint ansi-color ring
autoload radix-tree tar-mode arc-mode archive-mode = cus-edit cus-start
cus-load wid-edit cl-extra mm-archive message dired d= ired-loaddefs
format-spec rfc822 mml mml-sec epa derived gnus-util rmail=
rmail-loaddefs text-property-search time-date mailabbrev gmm-utils
m= ailheader mm-decode mm-bodies mm-encode mail-utils lisp-mnt help-mode
gn= utls network-stream url-http mail-parse rfc2231 rfc2047 rfc2045
mm-util = ietf-drums mail-prsvr url-gw nsm rmc puny url-cache url-auth url
url-pro= xy url-privacy url-expand url-methods url-history url-cookie
url-domsuf = url-util mailcap epg epg-config misearch multi-isearch
mule-util jka-com= pr info vc-git diff-mode easy-mmode term/xterm xterm
finder-inf rx packa= ge easymenu browse-url url-handlers url-parse
auth-source cl-seq eieio e= ieio-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-co= re
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang<= br>misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms<= br>cp51932 hebrew greek romanian slovak czech european ethiopic indian
c= yrillic chinese composite charscript charprop case-table epa-hook
jka-cm= pr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs
button = faces cus-face macroexp files text-properties overlay sha1 md5
base64 fo= rmat env code-pages mule custom widget hashtable-print-readable
backquot= e threads dbusbind inotify dynamic-setting system-font-setting
font-rend= er-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process e= macs)

Memory information:
((conses 16 557294 194503)
= =C2=A0(symbols 48 24597 2)
=C2=A0(strings 32 127018 26928)
=C2=A0(str= ing-bytes 1 3504683)
=C2=A0(vectors 16 33787)
=C2=A0(vector-slots 8 4= 06071 52780)
=C2=A0(floats 8 6497 1337)
=C2=A0(intervals 56 5924 5924= )
=C2=A0(buffers 1000 37)
=C2=A0(heap 1024 30911 9014))


--00000000000093c49b05b3eea93c--