commit 1e9af8c4d3c615f04f456306587959cdd6c49c26
Author: Jason Merrill <jason@redhat.com>
Date: Fri May 27 10:54:40 2011 -0400
PR c++/48284
* error.c (dump_expr) [COMPONENT_REF]: Use pp_cxx_dot
with INDIRECT_REF of REFERENCE_TYPE.
@@ -1890,7 +1890,10 @@ dump_expr (tree t, int flags)
&& strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this")))
{
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
new file mode 100644
@@ -0,0 +1,9 @@
+// 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" }
+