GNU bug report logs - #20629
25.0.50; Regression: TAGS broken, can't find anything in C++ files.

Previous Next

Package: emacs;

Reported by: "Jan D." <jan.h.d <at> swipnet.se>

Date: Fri, 22 May 2015 05:59:02 UTC

Severity: normal

Found in version 25.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: jan.h.d <at> swipnet.se
Cc: 20629 <at> debbugs.gnu.org
Subject: bug#20629: 25.0.50; Regression: TAGS broken, can't find anything in C++ files.
Date: Sat, 23 May 2015 17:46:18 +0300
> Date: Sat, 23 May 2015 16:50:11 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 20629 <at> debbugs.gnu.org
> 
> We should try to fix bugs without re-introducing previously solved
> ones.

Does the patch below give good results in real-life C++ usage?

Please also consider whether this change could cause trouble in other
C++ use cases.  (I've ran the modified version on the etags test
suite, and didn't spot any problems in the differences with the
previous results, but I don't consider myself an expert on C++
syntax.)

Thanks.

diff --git a/lib-src/etags.c b/lib-src/etags.c
index 28729da..cb96f06 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -3681,7 +3681,29 @@ enum,		0,			st_C_enum
 	  switch (fvdef)
 	    {
 	    case flistseen:
-	      make_C_tag (true);    /* a function */
+	      if ((c_ext & C_PLPL) != 0)
+		{
+		  /* Tag C++ member function names, excluding the class and
+		     namespace instances, if any.  */
+		  char *colon_colon = strstr (token_name.buffer, "::");
+		  char *colon_colon2 =
+		    colon_colon
+		    ? strstr (colon_colon + 2, "::")
+		    : NULL;
+
+		  if (colon_colon2 != NULL)
+		    colon_colon = colon_colon2;
+
+		  if (colon_colon != NULL)
+		    {
+		      memmove (token_name.buffer, colon_colon + 2,
+			       strlen (colon_colon + 2) + 1);
+		      token_name.len = strlen (token_name.buffer);
+		    }
+		  make_C_tag (true); /* a member function */
+		}
+	      else
+		make_C_tag (true);    /* a function */
 	      /* FALLTHRU */
 	    case fignore:
 	      fvdef = fvnone;




This bug report was last modified 9 years and 69 days ago.

Previous Next


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