typeck2.c (build_x_arrow): Early return if decay_conversion returns error_mark_node.

/gcc
2019-11-20  Paolo Carlini  <paolo.carlini@oracle.com>

	* typeck2.c (build_x_arrow): Early return if decay_conversion
	returns error_mark_node.

/testsuite
2019-11-20  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/parse/error43.C: Adjust expected error.

From-SVN: r278530
This commit is contained in:
Paolo Carlini 2019-11-20 21:03:05 +00:00 committed by Paolo Carlini
parent c013852d61
commit df2653441a
4 changed files with 15 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2019-11-20 Paolo Carlini <paolo.carlini@oracle.com>
* typeck2.c (build_x_arrow): Early return if decay_conversion
returns error_mark_node.
2019-11-20 Jakub Jelinek <jakub@redhat.com>
PR c++/90767

View file

@ -2044,7 +2044,11 @@ build_x_arrow (location_t loc, tree expr, tsubst_flags_t complain)
last_rval = convert_from_reference (last_rval);
}
else
last_rval = decay_conversion (expr, complain);
{
last_rval = decay_conversion (expr, complain);
if (last_rval == error_mark_node)
return error_mark_node;
}
if (TYPE_PTR_P (TREE_TYPE (last_rval)))
{

View file

@ -1,3 +1,7 @@
2019-11-20 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/parse/error43.C: Adjust expected error.
2019-11-20 Janne Blomqvist <jb@gcc.gnu.org>
* README: Use https for gcc.gnu.org.

View file

@ -2,4 +2,4 @@
// { dg-options "" }
class C { public: C* f(); int get(); };
int f(C* p) { return p->f->get(); } // { dg-error "forget the '\\(\\)'|base operand" }
int f(C* p) { return p->f->get(); } // { dg-error "25:invalid use of member function" }