re PR c++/60845 (print original type for typedef classes in diagnostics)
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 1 Dec 2014 14:58:01 +0000 (14:58 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 1 Dec 2014 14:58:01 +0000 (14:58 +0000)
/cp
2014-12-01  Paolo Carlini  <paolo.carlini@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.carlini@oracle.com>

PR c++/60845
* g++.dg/parse/error55.C: New.

From-SVN: r218218

gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/error55.C [new file with mode: 0644]

index 6ad557c1b947af6bbd638c4074564041f1553002..c8047612f57ffcae6c450076ac16d624c9150a3c 100644 (file)
@@ -1,3 +1,9 @@
+2014-12-01  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/60845
+       * typeck.c (finish_class_member_access_expr): Use %q#T instead of
+       %qD in error message.
+
 2014-11-29  Jakub Jelinek  <jakub@redhat.com>
 
        * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument
index 6ca346b8bd35e2c292dada0f94ffcdddcbc55da2..ae84b63c145931c3ff4fcb629e52829504a5e798 100644 (file)
@@ -2772,7 +2772,7 @@ finish_class_member_access_expr (tree object, tree name, bool template_p,
          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 e56f3d9bc4c6cad18a276559a1694264451d4e6f..0655cdf0238b2865e64826e65d9ffc4111fdf8d5 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-01  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/60845
+       * g++.dg/parse/error55.C: New.
+
 2014-12-01  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/15346
diff --git a/gcc/testsuite/g++.dg/parse/error55.C b/gcc/testsuite/g++.dg/parse/error55.C
new file mode 100644 (file)
index 0000000..24cca50
--- /dev/null
@@ -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'" }
+}