* [C++ PATCH] Fix ICE on invalid (PR c++/78341)
@ 2017-01-10 22:35 Jakub Jelinek
2017-01-11 17:56 ` Jason Merrill
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2017-01-10 22:35 UTC (permalink / raw)
To: Jason Merrill; +Cc: gcc-patches
Hi!
As mentioned in the PR, cp_parser_parse_definitely may fail even when
alignas_expr actually is meaningful, e.g. when the error is due to the
missing closing paren.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
2017-01-10 Jakub Jelinek <jakub@redhat.com>
PR c++/78341
* parser.c (cp_parser_std_attribute_spec): Remove over-eager
assertion. Formatting fix.
* g++.dg/cpp0x/pr78341.C: New test.
--- gcc/cp/parser.c.jj 2017-01-10 08:12:46.000000000 +0100
+++ gcc/cp/parser.c 2017-01-10 11:09:04.217456830 +0100
@@ -24931,11 +24931,7 @@ cp_parser_std_attribute_spec (cp_parser
if (!cp_parser_parse_definitely (parser))
{
- gcc_assert (alignas_expr == error_mark_node
- || alignas_expr == NULL_TREE);
-
- alignas_expr =
- cp_parser_assignment_expression (parser);
+ alignas_expr = cp_parser_assignment_expression (parser);
if (alignas_expr == error_mark_node)
cp_parser_skip_to_end_of_statement (parser);
if (alignas_expr == NULL_TREE
--- gcc/testsuite/g++.dg/cpp0x/pr78341.C.jj 2017-01-10 11:11:10.368843803 +0100
+++ gcc/testsuite/g++.dg/cpp0x/pr78341.C 2017-01-10 11:10:52.000000000 +0100
@@ -0,0 +1,4 @@
+// PR c++/78341
+// { dg-do compile { target c++11 } }
+
+alignas (alignas double // { dg-error "" }
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [C++ PATCH] Fix ICE on invalid (PR c++/78341)
2017-01-10 22:35 [C++ PATCH] Fix ICE on invalid (PR c++/78341) Jakub Jelinek
@ 2017-01-11 17:56 ` Jason Merrill
0 siblings, 0 replies; 2+ messages in thread
From: Jason Merrill @ 2017-01-11 17:56 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: gcc-patches List
OK.
On Tue, Jan 10, 2017 at 5:35 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> As mentioned in the PR, cp_parser_parse_definitely may fail even when
> alignas_expr actually is meaningful, e.g. when the error is due to the
> missing closing paren.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2017-01-10 Jakub Jelinek <jakub@redhat.com>
>
> PR c++/78341
> * parser.c (cp_parser_std_attribute_spec): Remove over-eager
> assertion. Formatting fix.
>
> * g++.dg/cpp0x/pr78341.C: New test.
>
> --- gcc/cp/parser.c.jj 2017-01-10 08:12:46.000000000 +0100
> +++ gcc/cp/parser.c 2017-01-10 11:09:04.217456830 +0100
> @@ -24931,11 +24931,7 @@ cp_parser_std_attribute_spec (cp_parser
>
> if (!cp_parser_parse_definitely (parser))
> {
> - gcc_assert (alignas_expr == error_mark_node
> - || alignas_expr == NULL_TREE);
> -
> - alignas_expr =
> - cp_parser_assignment_expression (parser);
> + alignas_expr = cp_parser_assignment_expression (parser);
> if (alignas_expr == error_mark_node)
> cp_parser_skip_to_end_of_statement (parser);
> if (alignas_expr == NULL_TREE
> --- gcc/testsuite/g++.dg/cpp0x/pr78341.C.jj 2017-01-10 11:11:10.368843803 +0100
> +++ gcc/testsuite/g++.dg/cpp0x/pr78341.C 2017-01-10 11:10:52.000000000 +0100
> @@ -0,0 +1,4 @@
> +// PR c++/78341
> +// { dg-do compile { target c++11 } }
> +
> +alignas (alignas double // { dg-error "" }
>
> Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-11 17:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-10 22:35 [C++ PATCH] Fix ICE on invalid (PR c++/78341) Jakub Jelinek
2017-01-11 17:56 ` Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).