Opened 4 years ago

Closed 4 years ago

#11257 closed enhancement (fixed)

false negative: constStatement with misused comma

Reported by: kidkat Owned by: noone
Priority: Normal Milestone: 2.9
Component: Improve check Version:
Keywords: constStatement regression Cc:

Description

From #11250:

int main(void)
{
    int y;
    y = (3,4) ; // y becomes 4
    (void)y;
}

This regressed with 2.2.

Change History (4)

comment:1 by kidkat, 4 years ago

Component: OtherImprove check

comment:2 by chrchr, 4 years ago

Keywords: ast added

Probably an AST issue: AST looks ok:

int f(int i, int j) {
	i = 3, 4;
	j = (3, 4);
	return i + j;
}
##AST
[test2.cpp:2]
,
|-= 'signed int'
| |-i 'signed int'
| `-3 'signed int'
`-4 'signed int'

[test2.cpp:3]
= 'signed int'
|-j 'signed int'
`-,
  |-3 'signed int'
  `-4 'signed int'
Last edited 4 years ago by chrchr (previous) (diff)

comment:3 by chrchr, 4 years ago

Keywords: ast removed

comment:4 by chrchr, 4 years ago

Milestone: 2.9
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.