Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctags doesn't handle some C++ templates correctly #1671

Closed
davisking opened this issue Jan 28, 2018 · 2 comments
Closed

ctags doesn't handle some C++ templates correctly #1671

davisking opened this issue Jan 28, 2018 · 2 comments
Assignees

Comments

@davisking
Copy link

I have this small template in my code:

template <long x, typename enabled=void>
struct tabs { const static long value = x; };

// specialize tabs
template <long x>
struct tabs<x,typename enable_if_c<(x<0)>::type> { const static long value = -x; };

This is legal C++, however, when ctags encounters this it stops parsing. All code in the source file that appears after the tabs declaration is invisible to ctags. For instance, if it were followed by

void my_function();

ctags would not output any mention of my_function in the resulting tags file. The general problem is the <(x<0)> in the specialization. In particular, if you take the inner < out ctags works fine. This kind of code pattern is pretty important because any time you are doing template metaprogramming with integers it's not super unusual to want to compare two integers that happen to be template arguments and have the result of that drive a template specialization. Any idea how easy this is to fix?

@masatake
Copy link
Member

@davisking, could you try the fix?

@davisking
Copy link
Author

Awesome, that appears to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants