summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/error.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/pr79304.C20
4 files changed, 33 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 04d2a6017e8..560bbfab3e8 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2017-01-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/79304
+ * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
+ after ARROW_EXPR.
+
2017-01-31 David Malcolm <dmalcolm@redhat.com>
PR c++/79298
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 4f4c11df570..92137f7c021 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2247,7 +2247,8 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags)
else
{
dump_expr (pp, ob, flags | TFF_EXPR_IN_PARENS);
- pp_cxx_dot (pp);
+ if (TREE_CODE (ob) != ARROW_EXPR)
+ pp_cxx_dot (pp);
}
dump_expr (pp, TREE_OPERAND (t, 1), flags & ~TFF_EXPR_IN_PARENS);
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ef50edab562..c313baa6437 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/79304
+ * g++.dg/diagnostic/pr79304.C: New test.
+
2017-01-31 David Malcolm <dmalcolm@redhat.com>
PR c++/79298
diff --git a/gcc/testsuite/g++.dg/diagnostic/pr79304.C b/gcc/testsuite/g++.dg/diagnostic/pr79304.C
new file mode 100644
index 00000000000..eedae42cbdf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/diagnostic/pr79304.C
@@ -0,0 +1,20 @@
+// PR c++/79304
+// { dg-do compile }
+
+struct C { };
+
+template<class T>
+struct X
+{
+ C* c;
+
+ void f() {
+ this->c.s(); // { dg-error "->c" }
+ }
+};
+
+int main()
+{
+ X<int> x;
+ x.f();
+}