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

C++ lambda in default template argument is incorrectly highlighted as error #1837

Closed
MC-DeltaT opened this issue Jun 23, 2022 · 1 comment · Fixed by #1839
Closed

C++ lambda in default template argument is incorrectly highlighted as error #1837

MC-DeltaT opened this issue Jun 23, 2022 · 1 comment · Fixed by #1839
Labels
bugfix-request A request for a bugfix to be developed. pr-open A PR addressing this issue is open.

Comments

@MC-DeltaT
Copy link

Name of the lexer
C++

Code sample

template<auto F = []{}>
void func();

Demo: http://rouge.jneen.net/v3.29.0/cpp/dGVtcGxhdGU8YXV0byBGID0gW117fT4Kdm9pZCBmdW5jKCk7Cg

Additional context
In general, I'd expect that any expression is valid in a template argument default.

@MC-DeltaT MC-DeltaT added the bugfix-request A request for a bugfix to be developed. label Jun 23, 2022
@MC-DeltaT
Copy link
Author

Actually seems like any braces in a template argument default is incorrectly highlighted as an error.

E.g. with a requires expression:

template<auto F = requires { foo(); }>
void func();

Demo: http://rouge.jneen.net/v3.29.0/cpp/dGVtcGxhdGU8YXV0byBGID0gcmVxdWlyZXMgeyBmb28oKTsgfT4Kdm9pZCBmdW5jKCk7Cg

@tancnle tancnle added the pr-open A PR addressing this issue is open. label Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix-request A request for a bugfix to be developed. pr-open A PR addressing this issue is open.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants