diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-01-11 19:09:58 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-01-11 19:09:58 +0100 |
commit | 1f258a55a9df39ecef35d0049c3bf703d6cdbe53 (patch) | |
tree | fe49ad9a513ca5b15d77702ed55765bc53bd6cc0 /gcc | |
parent | 6b5b4e9cece66553b75c1c8c9e7ecae6c8b27bb0 (diff) | |
download | gcc-1f258a55a9df39ecef35d0049c3bf703d6cdbe53.zip gcc-1f258a55a9df39ecef35d0049c3bf703d6cdbe53.tar.gz gcc-1f258a55a9df39ecef35d0049c3bf703d6cdbe53.tar.bz2 |
re PR c++/78341 (ICE on invalid C++ code on x86_64-linux-gnu (internal compiler error: in cp_parser_std_attribute_spec, at cp/parser.c:24597))
PR c++/78341
* parser.c (cp_parser_std_attribute_spec): Remove over-eager
assertion. Formatting fix.
* g++.dg/cpp0x/pr78341.C: New test.
From-SVN: r244329
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/parser.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr78341.C | 4 |
4 files changed, 14 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2b229f2..6ae85ae 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2017-01-11 Jakub Jelinek <jakub@redhat.com> + PR c++/78341 + * parser.c (cp_parser_std_attribute_spec): Remove over-eager + assertion. Formatting fix. + PR c++/72813 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after writing PCH file. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 7b3ee30..295c450 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -24925,11 +24925,7 @@ cp_parser_std_attribute_spec (cp_parser *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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bd56e7b..4df8d41 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-01-11 Jakub Jelinek <jakub@redhat.com> + + PR c++/78341 + * g++.dg/cpp0x/pr78341.C: New test. + 2017-01-11 Martin Sebor <msebor@redhat.com> PR c/78768 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr78341.C b/gcc/testsuite/g++.dg/cpp0x/pr78341.C new file mode 100644 index 0000000..af90638 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr78341.C @@ -0,0 +1,4 @@ +// PR c++/78341 +// { dg-do compile { target c++11 } } + +alignas (alignas double // { dg-error "" } |