bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

global c++ parser misses C++11 type alias (using)


From: Evghenii Gaburov
Subject: global c++ parser misses C++11 type alias (using)
Date: Wed, 8 Jul 2015 13:16:45 +0200

OS: Linux Ubuntu 14.04LTS & Mac OS X 10.10.2
GLOBAL: v6.5, built from source via configure && make && make install
COMMAND : gtags -v
EXPECT: detect C++11 type alias (using A = B;)
RESULT: C++11 type alias is not tagged

Here is the reproducer:
—————————————
$ cat > cvt.cpp
using my_type1 = double;
typedef float my_type2;

my_type2 cvt(my_type1 x)
{
   return static_cast<my_type2>(x);
}
^C
$ gtags --version
gtags (GNU GLOBAL) 6.5
Copyright (c) 2015 Tama Communications Corporation
License GPLv3+: GNU GPL version 3 or later <http://www.gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ gtags -v
[Wed Jul 08 13:11:29 CEST 2015] Gtags started.
[Wed Jul 08 13:11:29 CEST 2015] Creating 'GTAGS' and 'GRTAGS'.
 [1] extracting tags of cvt.cpp
[Wed Jul 08 13:11:29 CEST 2015] Done.
$ global -x my_type1
$ global -x my_type2
my_type2            2 cvt.cpp          typedef float my_type2;
$ 

Attached is a simple patch [by no means complete] that seems to fix the problem:
—————————————————
$ patch -p1 < global-6.5-using.patch 
patching file libparser/Cpp.c
make && make install
$ rm -rf G*
$ gtags -v
[Wed Jul 08 13:14:09 CEST 2015] Gtags started.
[Wed Jul 08 13:14:09 CEST 2015] Creating 'GTAGS' and 'GRTAGS'.
 [1] extracting tags of cvt.cpp
[Wed Jul 08 13:14:09 CEST 2015] Done.
$ global -x my_type1
my_type1            1 cvt.cpp          using my_type1 = double;
$ global -x my_type2
my_type2            2 cvt.cpp          typedef float my_type2;


Cheers,
  Evghenii

Attachment: global-6.5-using.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]