From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 80CCA388F047; Wed, 17 Jun 2020 16:45:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 80CCA388F047 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592412308; bh=8bxLK+MtV1nrL+sgGuPbdP4rcrtd6bco7HjrC2rbw88=; h=From:To:Subject:Date:From; b=dQplDtUaJBP+qRKEKjwF9aAXy5sp+8ZXQxqsX38nFL5h4T8oLPGh5qpk1BCWkplVT qTTor6YNiefy/5VtiqcqGbh0Ao8//cnqZyJNgANCJvbNZo3adrsk30Mnd+/E+uBcQe a2eR2BrSjPdo1hXB/pHUtLhX3sF/5a7dVjIXLVB4= From: "haoxintu at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95724] New: bogue error : "expected '{' before ')' token" Date: Wed, 17 Jun 2020 16:45:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: haoxintu at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 16:45:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95724 Bug ID: 95724 Summary: bogue error : "expected '{' before ')' token" Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code test.cc, GCC-trunk get a bogus error message and then get confused with following code parsing. $cat test.cc template <(union : decltype(a =3D 0)>) $g++-trunk -w -c test.cc test.cc:1:11: error: expected identifier before =E2=80=98(=E2=80=99 token 1 | template <(union : decltype(a =3D 0)>) | ^ test.cc:1:29: error: =E2=80=98a=E2=80=99 was not declared in this scope 1 | template <(union : decltype(a =3D 0)>) | ^ test.cc:1:29: error: =E2=80=98a=E2=80=99 was not declared in this scope test.cc:1:34: error: expected =E2=80=98{=E2=80=99 before =E2=80=98)=E2=80= =99 token 1 | template <(union : decltype(a =3D 0)>) | ^ test.cc:1:36: error: expected unqualified-id before =E2=80=98)=E2=80=99 tok= en 1 | template <(union : decltype(a =3D 0)>) | ^ $g++-10 -w -c test.cc test.cc:1:11: error: expected identifier before =E2=80=98(=E2=80=99 token 1 | template <(union : decltype(a =3D 0)>) | ^ test.cc:1:29: error: =E2=80=98a=E2=80=99 was not declared in this scope 1 | template <(union : decltype(a =3D 0)>) | ^ test.cc:1:29: error: =E2=80=98a=E2=80=99 was not declared in this scope test.cc:1:35: error: expected =E2=80=98{=E2=80=99 before =E2=80=98>=E2=80= =99 token 1 | template <(union : decltype(a =3D 0)>) | ^ test.cc:1:35: error: expected =E2=80=98,=E2=80=99 or =E2=80=98...=E2=80=99 = before =E2=80=98>=E2=80=99 token test.cc:1:36: error: expected =E2=80=98>=E2=80=99 at end of input 1 | template <(union : decltype(a =3D 0)>) | ^ test.cc:1:36: error: expected unqualified-id at end of input I guess GCC-trunk emits the bogus error message "expected =E2=80=98{=E2=80= =99 before =E2=80=98)=E2=80=99 token", and the following error messages are inconsistent with GCC-10. So, GCC-trunk might have something wrong with while parsing this code.=