Message ID | 20140912205202.GA23226@redhat.com |
---|---|
State | New |
Headers | show |
On 09/12/2014 04:52 PM, Marek Polacek wrote:
> + protected_set_expr_location (postfix_expression, loc);
Let's use the location of the (, which should just be token->location at
this point. So column 17 instead of 13 in the new test. OK with that
change.
In some cases postfix_expression won't be a CALL_EXPR at this point; it
might be a TARGET_EXPR or an INDIRECT_REF. But I suppose setting the
location on whatever it happens to be will work well enough for now.
Jason
diff --git gcc/gcc/cp/parser.c gcc/gcc/cp/parser.c index c696fd2..1bb72bc 100644 --- gcc/gcc/cp/parser.c +++ gcc/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, loc); + /* The POSTFIX_EXPRESSION is certainly no longer an id. */ idk = CP_ID_KIND_NONE; diff --git gcc/gcc/testsuite/g++.dg/diagnostic/pr60862.C gcc/gcc/testsuite/g++.dg/diagnostic/pr60862.C index e69de29..73b7654 100644 --- gcc/gcc/testsuite/g++.dg/diagnostic/pr60862.C +++ gcc/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 "13:invalid conversion" } +} diff --git gcc/libstdc++-v3/testsuite/20_util/bind/ref_neg.cc gcc/libstdc++-v3/testsuite/20_util/bind/ref_neg.cc index 5a46617..a85ccd8 100644 --- gcc/libstdc++-v3/testsuite/20_util/bind/ref_neg.cc +++ gcc/libstdc++-v3/testsuite/20_util/bind/ref_neg.cc @@ -31,9 +31,9 @@ void test01() const int dummy = 0; std::bind(&inc, _1)(0); // { dg-error "no match" } // { dg-error "rvalue|const" "" { target *-*-* } 1315 } - // { dg-error "rvalue|const" "" { target *-*-* } 1329 } - // { dg-error "rvalue|const" "" { target *-*-* } 1343 } - // { dg-error "rvalue|const" "" { target *-*-* } 1357 } + // { dg-error "rvalue|const" "" { target *-*-* } 1328 } + // { dg-error "rvalue|const" "" { target *-*-* } 1342 } + // { dg-error "rvalue|const" "" { target *-*-* } 1356 } std::bind(&inc, std::ref(dummy))(); // { dg-error "no match" } }