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++ lexer doesn't recognize function if return type is templated #1138

Open
Anteru opened this issue Aug 31, 2019 · 2 comments
Open

C++ lexer doesn't recognize function if return type is templated #1138

Anteru opened this issue Aug 31, 2019 · 2 comments
Labels
A-lexing area: changes to individual lexers good first issue Good for newcomers help wanted Community help appreciated!

Comments

@Anteru
Copy link
Collaborator

Anteru commented Aug 31, 2019

(Original issue 1434 created by kaka345 on 2018-03-31T17:49:31.980596+00:00)

For this snippet the function name isn't highlighted because its return type is a template:

#!c++
std::vector<int> func()
{
  std::vector<int> v = {0};
  return v;
}

For this snippet the function name is highlighted because its return type is not a template:

#!c++
int func()
{
  return 0;
}
@Anteru Anteru added T-bug type: a bug X-imported imported from Bitbucket S-major severity: major labels Aug 31, 2019
@Anteru Anteru added good first issue Good for newcomers help wanted Community help appreciated! A-lexing area: changes to individual lexers and removed X-imported imported from Bitbucket T-bug type: a bug S-major severity: major labels Mar 5, 2021
@Anteru
Copy link
Collaborator Author

Anteru commented Mar 5, 2021

Reproduced 2021-03-05

@bdaase
Copy link

bdaase commented Dec 23, 2022

Any template seems to be enough to reproduce this issue, it must not be on the return type.

template <float a>
int func()
{
  return 0;
}

This also reproduces the problem.

ZuxingGit added a commit to ZuxingGit/pygments that referenced this issue Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lexing area: changes to individual lexers good first issue Good for newcomers help wanted Community help appreciated!
Projects
None yet
Development

No branches or pull requests

2 participants