Hi,
Manuel noticed that in this error message it would be nice to have an
'aka' for typedefs. It seems to me that simply using the standard for
types %qT is most of it, but I propose also to add a '#' (otherwise we
regress on g++.dg/inherit/error5.C). Tested x86_64-linux.
Thanks,
Paolo.
////////////////////////////
/cp
2014-12-01 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/60845
* typeck.c (finish_class_member_access_expr): Use %q#T instead of
%qD in error message.
/testsuite
2014-12-01 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/60845
* g++.dg/parse/error55.C: New.
Index: cp/typeck.c
===================================================================
--- cp/typeck.c (revision 218204)
+++ cp/typeck.c (working copy)
@@ -2772,7 +2772,7 @@ finish_class_member_access_expr (tree object, tree
if (member == NULL_TREE)
{
if (complain & tf_error)
- error ("%qD has no member named %qE",
+ error ("%q#T has no member named %qE",
TREE_CODE (access_path) == TREE_BINFO
? TREE_TYPE (access_path) : object_type, name);
return error_mark_node;
Index: testsuite/g++.dg/parse/error55.C
===================================================================
--- testsuite/g++.dg/parse/error55.C (revision 0)
+++ testsuite/g++.dg/parse/error55.C (working copy)
@@ -0,0 +1,7 @@
+// PR c++/60845
+
+class A { };
+typedef A B;
+void foo (B &a) {
+ a.x(); // { dg-error "'B {aka class A}' has no member named 'x'" }
+}