https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124576
Bug ID: 124576
Summary: multiple evaluation of typeof arguments
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: uecker at gcc dot gnu.org
Target Milestone: ---
In the following example, j++ but not i++ is evaluated three times which is
wrong (thanks to Hsiang-Ying Fu)
int main() {
int i = 0;
int j = 0;
typeof((typeof(int[i++])*)(j++, 0)) a, b, c;
return j;
}
https://godbolt.org/z/PKhY8b4qo