C++ Return type on separate line is discarded
Brought to you by:
dhiebert
Functions with the return type on a separate line lose the return type.
Example:
int
foo() {
}
gives you:
foo t.ino /^foo() {$/;" kind:f line:2 signature:()
whereas it really should give you:
foo t.ino /^int foo() {$/;" kind:f line:2 signature:()
Or at least an optional field:
foo t.cpp /^foo() {$/;" kind:f line:2 signature:() return:int
ctags should not give this.
A tool reading tags file like vim recognizes the substring between / and / as a regular expression pattern.
^ int foo() {$doesn't match any substring in the original input.I'm not sure that the tool can handle
^ int\nfoo() {$. However, I guess it cannot. At least the new pattern including \n may break compatiblities.The tool can handle this one well. Unofficial fork maintained at https://ctags.io does what you expect:
typerefis used instad ofreturn.Great, thanks. I shall look at ctags.io. FYI, I'm using ctags to build a list of available functions in a GUI and need the return type. Also the same information is used to automatically populate a header file with function prototypes, and without the return type it breaks the code.