aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-11-09 12:52:57 -0500
committerJason Merrill <jason@gcc.gnu.org>2011-11-09 12:52:57 -0500
commit78d16361e1d3052e65d18229d6919d15d7bd21ff (patch)
tree87b569bd7b427f2c04d43746ca17374a0de9f872
parent161f270d4eae3953cb9e9bf020e9b8edadcb33a1 (diff)
downloadgcc-78d16361e1d3052e65d18229d6919d15d7bd21ff.zip
gcc-78d16361e1d3052e65d18229d6919d15d7bd21ff.tar.gz
gcc-78d16361e1d3052e65d18229d6919d15d7bd21ff.tar.bz2
parser.c (cp_parser_alias_declaration): Don't do semantic processing if parsing failed.
* parser.c (cp_parser_alias_declaration): Don't do semantic processing if parsing failed. From-SVN: r181218
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/parser.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7ebe23f..c975530 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-09 Jason Merrill <jason@redhat.com>
+
+ * parser.c (cp_parser_alias_declaration): Don't do semantic
+ processing if parsing failed.
+
2011-11-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51045
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 931c593..3cb6dbf 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -14946,6 +14946,9 @@ cp_parser_alias_declaration (cp_parser* parser)
type = cp_parser_type_id (parser);
cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);
+ if (cp_parser_error_occurred (parser))
+ return error_mark_node;
+
/* A typedef-name can also be introduced by an alias-declaration. The
identifier following the using keyword becomes a typedef-name. It has
the same semantics as if it were introduced by the typedef