Packages icon indicating copy to clipboard operation
Packages copied to clipboard

[C++] Pointer type as template parameter breaks syntax highlighting

Open brainplot opened this issue 5 years ago • 2 comments

I'm not sure if this is a bug or it's intended behavior but taking this code:

void foo()
{
  std::copy(first, last, std::ostream_iterator<T>(std::cout, "\n"));
}

when T is not a pointer type, std::ostream_iterator is highlighted differently from when T is a pointer type.

This is what it looks like when T is not a pointer type: value and this is what it looks like when T is a pointer type: pointer

The problem seems to be reproducible with any explicit template instantiation.

brainplot avatar Mar 30 '19 16:03 brainplot

This can be fixed by removing '*' from C++.sublime-syntax/variables.regular. And I don't see any side effects of changing this.

bumfo avatar Sep 03 '19 06:09 bumfo

This issue applies to references as well (which is rarer though), but fixing that is more complicated.

bumfo avatar Sep 03 '19 07:09 bumfo