Skip to content

ctags breaks on template instantiations that bitshift in parameters #120

Closed
@focalintent

Description

@focalintent

FastLED makes pretty extensive use of templates to do a lot of this work. Some of what's done with templates involves creating bitmasks from template parameters as parameters to other templates. Unfortunately, when the ctags parser sees "1<<X" as a template parameter, it eats itself.

This code demonstrates the problem:

template <int PORT_MASK> class controller { 

};

template <int LANES> class myClass { 
  public:
    void useController(controller<(1<<LANES)-1> & controller);    
};

void setup() { myctagstestfunc(); }
void myctagstestfunc() { }
void loop() {}

Because ctags stops parsing, the prototype for myctagstestfunc() is never created, and the dreaded 'myctagstestfun' was not declared in this scope error (as seen in #68)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions