typeck2.c (build_x_arrow): Early return if decay_conversion returns error_mark_node.
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 20 Nov 2019 21:03:05 +0000 (21:03 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 20 Nov 2019 21:03:05 +0000 (21:03 +0000)
/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

gcc/cp/ChangeLog
gcc/cp/typeck2.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/error43.C

index 6031acf360918e19ef982c142e5854ef79c400f1..55ee3b8eb498299a802f8819e0b1517d1376f136 100644 (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
index 9fb36fd1ed320321faf1f36dc4282b65780459a4..7a8de4b7c2c7e3da52241323183408853d2caeee 100644 (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)))
     {
index 2a4d5c6bccb89a5edab2c338f8cb9f7fe8c37ff9..36fabc7f3fb21b6ef90f5c77d0cf18d64997c0e2 100644 (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.
index e352fa5c70d83f88fdc611730e714180ca8c032c..1a72cbce20513442b450afcfb6f76141b3a60caa 100644 (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" }