Commit 87fd3cf1 by Jason Merrill Committed by Jason Merrill

re PR c++/48284 ([C++0x] incorrect printing of decltype operand in diagnostic)

	PR c++/48284
	* error.c (dump_expr) [COMPONENT_REF]: Use pp_cxx_dot
	with INDIRECT_REF of REFERENCE_TYPE.

From-SVN: r174353
parent 04536942
2011-05-27 Jason Merrill <jason@redhat.com> 2011-05-27 Jason Merrill <jason@redhat.com>
PR c++/48284
* error.c (dump_expr) [COMPONENT_REF]: Use pp_cxx_dot
with INDIRECT_REF of REFERENCE_TYPE.
PR c++/49181 PR c++/49181
* pt.c (get_mostly_instantiated_function_type): Use push_access_scope. * pt.c (get_mostly_instantiated_function_type): Use push_access_scope.
......
...@@ -1890,7 +1890,10 @@ dump_expr (tree t, int flags) ...@@ -1890,7 +1890,10 @@ dump_expr (tree t, int flags)
&& strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this"))) && strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this")))
{ {
dump_expr (ob, flags | TFF_EXPR_IN_PARENS); dump_expr (ob, flags | TFF_EXPR_IN_PARENS);
pp_cxx_arrow (cxx_pp); if (TREE_CODE (TREE_TYPE (ob)) == REFERENCE_TYPE)
pp_cxx_dot (cxx_pp);
else
pp_cxx_arrow (cxx_pp);
} }
} }
else else
......
2011-05-27 Jason Merrill <jason@redhat.com> 2011-05-27 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/error6.C: New.
* g++.dg/cpp0x/error5.C: New. * g++.dg/cpp0x/error5.C: New.
2011-05-27 Jakub Jelinek <jakub@redhat.com> 2011-05-27 Jakub Jelinek <jakub@redhat.com>
......
// PR c++/48284
// { dg-options -std=c++0x }
template<typename C>
auto g(C& c) -> decltype (c.f()) { return c.f(); } // { dg-error "decltype .c\\.f" }
template<typename C>
auto g(C& c) -> decltype (c.f()) { return c.f(); } // { dg-error "decltype .c\\.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