Even RO_ARROW_STAR can end up in invalid_indirection_error in invalid
code, so handle that instead of ICEing later on.

Regtested/bootstrapped on x86_64-linux, ok for trunk and 4.8?

2013-11-04  Marek Polacek  <pola...@redhat.com>

        PR c++/58979
c-family/
        * c-common.c (invalid_indirection_error): Handle RO_ARROW_STAR case.
testsuite/
        * g++.dg/diagnostic/pr58979.C: New test.

--- gcc/c-family/c-common.c.mp2 2013-11-04 10:30:15.265951084 +0100
+++ gcc/c-family/c-common.c     2013-11-04 10:47:29.164783425 +0100
@@ -9930,6 +9930,7 @@ invalid_indirection_error (location_t lo
                type);
       break;
     case RO_ARROW:
+    case RO_ARROW_STAR:
       error_at (loc,
                "invalid type argument of %<->%> (have %qT)",
                type);
--- gcc/testsuite/g++.dg/diagnostic/pr58979.C.mp2       2013-11-04 
11:09:30.515553664 +0100
+++ gcc/testsuite/g++.dg/diagnostic/pr58979.C   2013-11-04 11:09:26.505538785 
+0100
@@ -0,0 +1,4 @@
+// PR c++/58979
+// { dg-do compile }
+
+int i = 0->*0; // { dg-error "invalid type argument of" }

        Marek

Reply via email to