ltcmelo / psychec

A compiler frontend for the C programming language
BSD 3-Clause "New" or "Revised" License
538 stars 39 forks source link

Valid compound literal not recognized #7

Closed condekind closed 3 years ago

condekind commented 3 years ago

Compiled without errors with GCC and Clang (both trunk) with options -c and -pedantic

ISO C Standard -std=c11

Version Screenshot of git show --summary plus a local compilation (also tested in Godbolt's Comp. Explorer):

commit

The snippet

int main() {

  struct s_s
  {
    int i;
  };

  return (struct s_s){.i=42}.i;
}

Hope it helps, psyche-c helped us a lot when working on AnghaBench :)

ltcmelo commented 3 years ago

Thank you @condekind , sure it helps (you'll get a bounty). And I'm glad to hear that psyche was of aid.

ltcmelo commented 3 years ago

Fixed with https://github.com/ltcmelo/psychec/commit/d10dc1ddfb7ea845f59274a4d6ca5d021ab31423