From df2653441a24175e1c909a1234413730c10535e4 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 20 Nov 2019 21:03:05 +0000 Subject: [PATCH] typeck2.c (build_x_arrow): Early return if decay_conversion returns error_mark_node. /gcc 2019-11-20 Paolo Carlini * typeck2.c (build_x_arrow): Early return if decay_conversion returns error_mark_node. /testsuite 2019-11-20 Paolo Carlini * g++.dg/parse/error43.C: Adjust expected error. From-SVN: r278530 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/typeck2.c | 6 +++++- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.dg/parse/error43.C | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6031acf3609..55ee3b8eb49 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2019-11-20 Paolo Carlini + + * typeck2.c (build_x_arrow): Early return if decay_conversion + returns error_mark_node. + 2019-11-20 Jakub Jelinek PR c++/90767 diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 9fb36fd1ed3..7a8de4b7c2c 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -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))) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2a4d5c6bccb..36fabc7f3fb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-11-20 Paolo Carlini + + * g++.dg/parse/error43.C: Adjust expected error. + 2019-11-20 Janne Blomqvist * README: Use https for gcc.gnu.org. diff --git a/gcc/testsuite/g++.dg/parse/error43.C b/gcc/testsuite/g++.dg/parse/error43.C index e352fa5c70d..1a72cbce205 100644 --- a/gcc/testsuite/g++.dg/parse/error43.C +++ b/gcc/testsuite/g++.dg/parse/error43.C @@ -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" } -- 2.30.2