pt.c (tsubst_qualified_id): Improved error message when a type is expected but not...
authorGiovanni Bajo <giovannibajo@gcc.gnu.org>
Mon, 2 Feb 2004 01:07:08 +0000 (01:07 +0000)
committerGiovanni Bajo <giovannibajo@gcc.gnu.org>
Mon, 2 Feb 2004 01:07:08 +0000 (01:07 +0000)
* pt.c (tsubst_qualified_id): Improved error message when a type
is expected but not found.

From-SVN: r77089

gcc/cp/pt.c

index 53206776acd92b3759f367ffd2564b36616d2b59..633aa760b21cd072864c60831fa1728ef75ccc23 100644 (file)
@@ -7264,8 +7264,11 @@ tsubst_qualified_id (tree qualified_id, tree args,
                     ? DECL_TEMPLATE_RESULT (expr) : expr) == TYPE_DECL)
        {
          if (complain & tf_error)
-           error ("`%E' names a type, but a non-type is expected",
-                  qualified_id);
+           {
+             error ("dependent-name`%E' is parsed as a non-type, but "
+                    "instantiation yields a type", qualified_id);
+             inform ("say `typename %E' if a type is meant", qualified_id);
+           }
          return error_mark_node;
        }
     }