From: prathamesh3492 Date: Sat, 23 May 2015 19:52:05 +0000 (+0000) Subject: 2015-05-23 Prathamesh Kulkarni X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbe4b31fa7628ae70c48fce6b59979f7f4a9822c;p=thirdparty%2Fgcc.git 2015-05-23 Prathamesh Kulkarni * genmatch.c (parser::parse_for): Reject iterator if used as operator-list. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223610 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b82d9464ccc6..1d18ffd92a95 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2015-05-20 Prathamesh Kulkarni + + * genmatch.c (parser::parse_for): Reject iterator if used as operator-list. + 2015-05-23 Prathamesh Kulkarni * genmatch.c (parser::parse_operator_list): Check for CPP_CLOSE_PAREN after end of id-list. diff --git a/gcc/genmatch.c b/gcc/genmatch.c index 4ea1cc9ee76e..d1cf87215e06 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -3329,8 +3329,13 @@ parser::parse_for (source_location) "others with arity %d", oper, idb->nargs, arity); user_id *p = dyn_cast (idb); - if (p && p->is_oper_list) - op->substitutes.safe_splice (p->substitutes); + if (p) + { + if (p->is_oper_list) + op->substitutes.safe_splice (p->substitutes); + else + fatal_at (token, "iterator cannot be used as operator-list"); + } else op->substitutes.safe_push (idb); }