https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101232

--- Comment #1 from Tobias Schlüter <tobi at gcc dot gnu.org> ---
BTW an equivalent C example gives the proper error both with C and C++
https://godbolt.org/z/sWc67eWT8
=====================
struct X {
    int a;
    int b;
};

void f() {
    struct X x = { 1, 2; };
}
=====================

<source>: In function 'void f()':
<source>:7:24: error: expected '}' before ';' token
    7 |     struct X x = { 1, 2; };
      |                  ~     ^
<source>: At global scope:
<source>:8:1: error: expected declaration before '}' token
    8 | }
      | ^

Reply via email to