OSDN Git Service

2012-06-14 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Jun 2012 12:55:11 +0000 (12:55 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Jun 2012 12:55:11 +0000 (12:55 +0000)
        Backport from mainline
        2012-06-06  Fabien Chene  <fabien@gcc.gnu.org>

PR c++/52841
* parser.c (cp_parser_alias_declaration): Return earlier
if an error occured.

* g++.dg/cpp0x/pr52841.C: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@188613 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 2d31ce7..9b5a215 100644 (file)
@@ -1,3 +1,12 @@
+2012-06-14  Richard Guenther  <rguenther@suse.de>
+
+       Backport from mainline
+       2012-06-06  Fabien ChĂȘne  <fabien@gcc.gnu.org>
+
+       PR c++/52841
+       * parser.c (cp_parser_alias_declaration): Return earlier
+       if an error occured.
+
 2012-06-14  Release Manager
 
        * GCC 4.7.1 released.
 2012-06-14  Release Manager
 
        * GCC 4.7.1 released.
index 74d5d1f..6a9d63a 100644 (file)
@@ -15071,6 +15071,9 @@ cp_parser_alias_declaration (cp_parser* parser)
 
   cp_parser_require (parser, CPP_EQ, RT_EQ);
 
 
   cp_parser_require (parser, CPP_EQ, RT_EQ);
 
+  if (cp_parser_error_occurred (parser))
+    return error_mark_node;
+
   /* Now we are going to parse the type-id of the declaration.  */
 
   /*
   /* Now we are going to parse the type-id of the declaration.  */
 
   /*
index 496ae64..36f2376 100644 (file)
@@ -1,3 +1,11 @@
+2012-06-14  Richard Guenther  <rguenther@suse.de>
+
+       Backport from mainline
+       2012-06-06  Fabien ChĂȘne  <fabien@gcc.gnu.org>
+
+       PR c++/52841
+       * g++.dg/cpp0x/pr52841.C: New testcase.
+
 2012-06-13  Christian Bruel  <christian.bruel@st.com>
 
        PR target/53621
 2012-06-13  Christian Bruel  <christian.bruel@st.com>
 
        PR target/53621
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr52841.C b/gcc/testsuite/g++.dg/cpp0x/pr52841.C
new file mode 100644 (file)
index 0000000..f6467f8
--- /dev/null
@@ -0,0 +1,17 @@
+// { dg-do compile }
+
+struct Solvable;
+namespace sat
+{
+  class Solvable
+    {
+  public:
+      typedef bool bool_type;
+    };
+}
+
+class Resolvable : public sat::Solvable
+{
+public:
+  using sat::Solvable::bool_type;
+};