re PR c++/58979 (ICE with invalid use of pointer-to-member)
authorMarek Polacek <polacek@redhat.com>
Mon, 4 Nov 2013 16:01:49 +0000 (16:01 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Mon, 4 Nov 2013 16:01:49 +0000 (16:01 +0000)
PR c++/58979
c-family/
* c-common.c (invalid_indirection_error): Handle RO_ARROW_STAR case.
testsuite/
* g++.dg/diagnostic/pr58979.C: New test.

From-SVN: r204352

gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/diagnostic/pr58979.C [new file with mode: 0644]

index 6747bdd24af9489f8ea11ffb17aa14d7067690d7..067c1341180381782f35f8604877175986f8e84d 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-04  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/58979
+       * c-common.c (invalid_indirection_error): Handle RO_ARROW_STAR case.
+
 2013-11-04  Joseph Myers  <joseph@codesourcery.com>
 
        * c-cppbuiltin.c (cpp_iec_559_value, cpp_iec_559_complex_value):
index b01b9d01e6d0c44ff1633a56fa6d6ff1dfdcafcf..030ee5a643d365cb3fb4a9be76f81122e132a0a9 100644 (file)
@@ -9934,6 +9934,11 @@ invalid_indirection_error (location_t loc, tree type, ref_operator errstring)
                "invalid type argument of %<->%> (have %qT)",
                type);
       break;
+    case RO_ARROW_STAR:
+      error_at (loc,
+               "invalid type argument of %<->*%> (have %qT)",
+               type);
+      break;
     case RO_IMPLICIT_CONVERSION:
       error_at (loc,
                "invalid type argument of implicit conversion (have %qT)",
index 3ebaf82a760d859cd56a43a1692fd5fdc47d8012..4da6480faa3a55b26936912812a75d915658f236 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-04  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/58979
+       * g++.dg/diagnostic/pr58979.C: New test.
+
 2013-11-04  Joseph Myers  <joseph@codesourcery.com>
 
        * gcc.dg/iec-559-macros-1.c, gcc.dg/iec-559-macros-2.c,
diff --git a/gcc/testsuite/g++.dg/diagnostic/pr58979.C b/gcc/testsuite/g++.dg/diagnostic/pr58979.C
new file mode 100644 (file)
index 0000000..6be3f14
--- /dev/null
@@ -0,0 +1,4 @@
+// PR c++/58979
+// { dg-do compile }
+
+int i = 0->*0; // { dg-error "invalid type argument of" }