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

Syntax Highlighting/Tokenization breaks in C++ if template parameter contains a less-than (<) comparison #660

Open
1 task
alexr00 opened this issue Aug 13, 2024 · 0 comments

Comments

@alexr00
Copy link

alexr00 commented Aug 13, 2024

Checklist

  • This problem exists even with the setting "C_Cpp.enhancedColorization": "Disabled"

If Disabling that^ makes the problem go away, then follow this to make an issue on the C++ extension:
https://github.com/microsoft/vscode-cpptools/issues/new/choose

The code with a problem is:

template<bool V>
struct foo { bool value = V; };
template<typename T>
struct bar : foo<(T(-1) < T(0))> {};
template<typename T>
struct bar<T> : false_type {};

It looks like:

The < within the template parameter of bar is interpreted as the opening angle bracket of a template instead of a less than:

punctuation.section.angle-brackets.begin.template.call.cpp
meta.template.call.cpp
meta.template.call.cpp
meta.head.struct.cpp
meta.block.struct.cpp
source.cpp
image image

It should look like:

The template on line 5 should get the same color/scope as the other templates.

Originally from @lethalbit in microsoft/vscode#225314

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

1 participant