ctags parsing fails on static_assert C++11 keyword
Brought to you by:
dhiebert
I recently found that ctags wasn't outputting tags for my functions and found that in some cases, the C++11 keyword can cause ctags to stop parsing. So far, I've found two ways ctags can handle static_assert. Some are parsed as a function prototype, like this:
$ cat test.cpp static_assert(sizeof(int) < 4, "foo"); $ ctags -f - --c++-kinds=p test.cpp sizeof test.cpp /^static_assert(sizeof(int) < 4, "foo");$/;" p file:
Others, produce not output, but also suppress output for all subsequent code:
matthijs@grubby:/tmp$ cat test2.cpp static_assert(a < b, "bar"); int test(); matthijs@grubby:/tmp$ ctags -f - --c++-kinds=p test2.cpp (no output produced)
Especially the latter is annoying. This should probably be fixed by properly parsing static_assert directives.
https://github.com/igrr/ctags/commit/ef67b47e61a1a5f6258e7034ddb520a57b0a477e
The same needs to be done for the c11 keyword _Static_assert
https://en.cppreference.com/w/c/keyword/_Static_assert