Skip to content

thread is wrongly highlighted for C/C++

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

When C++ code contains thread, it is highlighted as reserved identifier, but thread is not reserved in C++.

Steps to reproduce

std::thread thread;
std::thread not_highlighted;

int i;
thread g;

Example Project

https://gitlab.com/-/snippets/2049969

What is the current bug behavior?

thread is wrongly highlighted.

What is the expected correct behavior?

thread is not highlighted at all.

Relevant logs and/or screenshots

image

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by 🤖 GitLab Bot 🤖