re PR c++/78341 (ICE on invalid C++ code on x86_64-linux-gnu (internal compiler...
authorJakub Jelinek <jakub@redhat.com>
Wed, 11 Jan 2017 18:09:58 +0000 (19:09 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 11 Jan 2017 18:09:58 +0000 (19:09 +0100)
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

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr78341.C [new file with mode: 0644]

index 2b229f2aae71bd29d7845f4f612dff055038988f..6ae85ae6c7d034b961da634c5050da9a0dfccb9b 100644 (file)
@@ -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.
index 7b3ee30345ef843077fb83bfa1e265c992be00f1..295c450507d0082b77e89ef1841bd38525417129 100644 (file)
@@ -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
index bd56e7bcefbd84d7e67a97f67177641a583d0e26..4df8d41da99fdf1aa64d2958d12e1e81f1296792 100644 (file)
@@ -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 (file)
index 0000000..af90638
--- /dev/null
@@ -0,0 +1,4 @@
+// PR c++/78341
+// { dg-do compile { target c++11 } }
+
+alignas (alignas double // { dg-error "" }