#193 std::string const &f() {} gets class:std

open
nobody
None
5
2007-09-21
2007-09-21
Elliott Hughes
No

this file:

std::string & f1() {}
const std::string & f2() {}
std::string const & f3() {};

produces these tags:

C test.cpp 1;" c file:
f1 test.cpp 2;" f class:C file:
f2 test.cpp 3;" f class:C file:
f3 test.cpp 4;" f class:C::std file:

with ctags 5.6 and 5.7. the scope information is wrong for f3.

Discussion

  • Elliott Hughes
    Elliott Hughes
    2007-09-21

    Logged In: YES
    user_id=1127237
    Originator: YES

    duh. i messed up the tags because i simplified the test case (removing the surrounding "class C") without re-pasting the tags. here's the actual tags:

    f1 test.cpp 1;" f
    f2 test.cpp 2;" f
    f3 test.cpp 3;" f class:std

    as you see, there's a problem with both global and member functions.

     
  • Elliott Hughes
    Elliott Hughes
    2007-09-21

    • summary: std::string const &f() {} --> std::string const &f() {} gets class:std
     
  • Elliott Hughes
    Elliott Hughes
    2007-09-21

    Logged In: YES
    user_id=1127237
    Originator: YES

    (also, you can ignore the spurious semicolon in my example. it's not relevant. the "Test/bug1799340.cpp" doesn't have the semicolon but does have the problem.)

     
  • Elliott Hughes
    Elliott Hughes
    2008-03-17

    Logged In: YES
    user_id=1127237
    Originator: YES

    see also bug #1907083.