Commit df265344 by Paolo Carlini Committed by Paolo Carlini

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
parent c013852d
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> 2019-11-20 Jakub Jelinek <jakub@redhat.com>
PR c++/90767 PR c++/90767
......
...@@ -2044,7 +2044,11 @@ build_x_arrow (location_t loc, tree expr, tsubst_flags_t complain) ...@@ -2044,7 +2044,11 @@ build_x_arrow (location_t loc, tree expr, tsubst_flags_t complain)
last_rval = convert_from_reference (last_rval); last_rval = convert_from_reference (last_rval);
} }
else 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))) if (TYPE_PTR_P (TREE_TYPE (last_rval)))
{ {
......
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> 2019-11-20 Janne Blomqvist <jb@gcc.gnu.org>
* README: Use https for gcc.gnu.org. * README: Use https for gcc.gnu.org.
......
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
// { dg-options "" } // { dg-options "" }
class C { public: C* f(); int get(); }; 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" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment