]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/59120 ([c++11] ICE with invalid template alias)
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 28 Apr 2014 12:32:06 +0000 (12:32 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 28 Apr 2014 12:32:06 +0000 (12:32 +0000)
/cp
2014-04-28  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/59120
* parser.c (cp_parser_alias_declaration): Check return value of
cp_parser_require.

/testsuite
2014-04-28  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/59120
* g++.dg/cpp0x/alias-decl-43.C: New.

From-SVN: r209857

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

index 584046150bcfe352821cd549fe6e830e9e7cfa75..a5f3829d70516c3b740c9ee3916c7f6548540338 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/59120
+       * parser.c (cp_parser_alias_declaration): Check return value of
+       cp_parser_require.
+
 2014-04-24  Jakub Jelinek  <jakub@redhat.com>
 
        * parser.c (cp_parser_omp_atomic): Allow seq_cst before
index c1d94ae92b52b1e10222b935533ae8c3ded49dca..962cacedf80ae9d22f5e6df69e8bdf23b18412ba 100644 (file)
@@ -16142,15 +16142,8 @@ cp_parser_alias_declaration (cp_parser* parser)
   if (parser->num_template_parameter_lists)
     parser->type_definition_forbidden_message = saved_message;
 
-  if (type == error_mark_node)
-    {
-      cp_parser_skip_to_end_of_block_or_statement (parser);
-      return error_mark_node;
-    }
-
-  cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);
-
-  if (cp_parser_error_occurred (parser))
+  if (type == error_mark_node
+      || !cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON))
     {
       cp_parser_skip_to_end_of_block_or_statement (parser);
       return error_mark_node;
index ba21fed78f3a5666f15bb7309f4b0a5d87abd888..9cede570bc0419e81ca83f40388a45d9fc2b054c 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/59120
+       * g++.dg/cpp0x/alias-decl-43.C: New.
+
 2014-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/59604
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-43.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-43.C
new file mode 100644 (file)
index 0000000..02eb336
--- /dev/null
@@ -0,0 +1,4 @@
+// PR c++/59120
+// { dg-do compile { target c++11 } }
+
+template<typename T> using X = int T::T*;  // { dg-error "expected" }