Commit 19bdccb4 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/79304 (diagnostic shows bogus expression ((X<T>*)this)->.c)

	PR c++/79304
	* error.c (dump_expr) <case COMPONENT_REF>: Don't print .
	after ARROW_EXPR.

	* g++.dg/diagnostic/pr79304.C: New test.

From-SVN: r245073
parent fcb2cdfc
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
......
......@@ -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);
}
......
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
......
// 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();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment