On 3/7/22 08:04, Roger Sayle wrote:

This patch fixes PR c++/96329 which is an ICE-on-invalid-code regression
affecting mainline.

This patch has been tested on x86_64-pc-linux-gnu, enabling languages
c and c++, with make bootstrap and make -k check with no new failures.
Ok for mainline?

2022-03-07  Roger Sayle  <ro...@nextmovesoftware.com>

gcc/cp/ChangeLog
        PR c++/96329
        * parser.cc (cp_parser_linkage_specification): Treat the case where
        linkage is error_mark_node as "invalid linkage-specification".

gcc/testsuite/ChangeLog
        PR c++/96329
        * g++.dg/pr96329.C: New test case.

+/* { dg-options "-O2" } */

Is this necessary for the failure? That would be surprising for a parser issue.

And this should probably go in g++.dg/template.

OK with those adjustments.

Jason

Reply via email to