X Tutup
Skip to content

Fix syntaxError when not/compl is used as identifiers (C)#8384

Open
wilhelma wants to merge 1 commit intodanmar:mainfrom
cqse:not_as_parameter_name
Open

Fix syntaxError when not/compl is used as identifiers (C)#8384
wilhelma wants to merge 1 commit intodanmar:mainfrom
cqse:not_as_parameter_name

Conversation

@wilhelma
Copy link
Copy Markdown

Fix false syntaxError when C alternative tokens (not/compl) are used as identifiers (parameters)

Minimal Example

static void foo(int not, int test)
{
  test = not;
}

Solution
Add C-mode declaration guard to the not/compl branch in simplifyCAlternativeTokens() and extend both guards to cover last-parameter position.

@sonarqubecloud
Copy link
Copy Markdown

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

Successfully merging this pull request may close these issues.

1 participant

X Tutup