From: mpolacek Date: Sat, 13 Sep 2014 07:54:40 +0000 (+0000) Subject: PR c++/60862 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=763c6e82f22f1a3006567d68ed86108cc06df816;p=thirdparty%2Fgcc.git PR c++/60862 * parser.c (cp_parser_postfix_expression) : Set location of a call expression. * g++.dg/diagnostic/pr60862.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215235 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3e9cb8968240..ff72fd01a8fd 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-09-13 Marek Polacek + + PR c++/60862 + * parser.c (cp_parser_postfix_expression) : Set + location of a call expression. + 2014-09-11 Jason Merrill PR c++/63201 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index c696fd2e6be3..a3c947a9a690 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -6227,6 +6227,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, koenig_p, complain); + protected_set_expr_location (postfix_expression, token->location); + /* The POSTFIX_EXPRESSION is certainly no longer an id. */ idk = CP_ID_KIND_NONE; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 20defa5bc3ec..29d89a8b2c1e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-09-13 Marek Polacek + + PR c++/60862 + * g++.dg/diagnostic/pr60862.C: New test. + 2014-09-12 Richard Biener PR middle-end/63237 diff --git a/gcc/testsuite/g++.dg/diagnostic/pr60862.C b/gcc/testsuite/g++.dg/diagnostic/pr60862.C new file mode 100644 index 000000000000..cc5279cde6b2 --- /dev/null +++ b/gcc/testsuite/g++.dg/diagnostic/pr60862.C @@ -0,0 +1,10 @@ +// PR c++/60862 +// { dg-do compile } + +extern void **bar (int, void *, int); + +void +foo (int x, int y) +{ + int **s = bar (x, &x, y); // { dg-error "17:invalid conversion" } +}