PR c++/33844
* cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
->* rather than .*.
* error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
* g++.dg/other/ptrmem8.C: New test.
From-SVN: r129682
+2007-10-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/33844
+ * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
+ ->* rather than .*.
+ * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
+
2007-10-27 Jason Merrill <jason@redhat.com>
PR c++/5247
case MEMBER_REF:
case DOTSTAR_EXPR:
pp_cxx_pm_expression (pp, TREE_OPERAND (t, 0));
- pp_cxx_dot (pp);
+ if (TREE_CODE (t) == MEMBER_REF)
+ pp_cxx_arrow (pp);
+ else
+ pp_cxx_dot (pp);
pp_star(pp);
pp_cxx_cast_expression (pp, TREE_OPERAND (t, 1));
break;
pp_cxx_offsetof_expression (cxx_pp, t);
break;
+ case MEMBER_REF:
+ case DOTSTAR_EXPR:
+ pp_multiplicative_expression (cxx_pp, t);
+ break;
+
case DELETE_EXPR:
case VEC_DELETE_EXPR:
pp_cxx_delete_expression (cxx_pp, t);
2007-10-27 Jakub Jelinek <jakub@redhat.com>
+ PR c++/33844
+ * g++.dg/other/ptrmem8.C: New test.
+
PR c++/33842
* g++.dg/template/error34.C: New test.
--- /dev/null
+// PR c++/33844
+// { dg-do compile }
+
+struct A {};
+
+template<int> void foo(void (A::* f)())
+{
+ A a;
+ &(a.*f); // { dg-error "invalid use of\[^\n\]*\\.\\*\[^\n\]*to form|qualified-id is required" }
+}
+
+template<int> void bar(void (A::* f)())
+{
+ A *p;
+ &(p->*f); // { dg-error "invalid use of\[^\n\]*->\\*\[^\n\]*to form|qualified-id is required" }
+}