decl.c (make_typename_type): Move error to point where name variable can be used...
authorBenjamin Kosnik <bkoz@loony.cygnus.com>
Tue, 22 Sep 1998 12:05:50 +0000 (12:05 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 22 Sep 1998 12:05:50 +0000 (12:05 +0000)

1998-09-22  Benjamin Kosnik  <bkoz@loony.cygnus.com>
        * decl.c (make_typename_type): Move error to point where name
        variable can be used by dump_type.

From-SVN: r22550

gcc/cp/ChangeLog
gcc/cp/decl.c

index 360dcb088d07ae259f6057a6c5259e81f4306144..ade676367dec6708f160312a92dc2566763f583d 100644 (file)
@@ -1,3 +1,8 @@
+1998-09-22  Benjamin Kosnik  <bkoz@loony.cygnus.com>
+
+        * decl.c (make_typename_type): Move error to point where name
+        variable can be used by dump_type.
+
 1998-09-22  Mark Mitchell  <mark@markmitchell.com>
 
        * decl.c (grokfndecl): Improve error-recovery.
index 17078e0ae7c8d46e362a8ee33c0c4d9a886edf36..a8317cc698c1133ab4adf42551ccf90fbc47fa57 100644 (file)
@@ -4787,15 +4787,6 @@ make_typename_type (context, name)
 
   fullname = name;
 
-  if (TREE_CODE (context) == NAMESPACE_DECL)
-    {
-      /* We can get here from typename_sub0 in the explicit_template_type
-        expansion.  Just fail.  */
-      cp_error ("no class template named `%#T' in `%#T'",
-               name, context);
-      return error_mark_node;
-    }
-
   if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
     {
       name = TREE_OPERAND (name, 0);
@@ -4805,6 +4796,15 @@ make_typename_type (context, name)
   if (TREE_CODE (name) != IDENTIFIER_NODE)
     my_friendly_abort (2000);
 
+  if (TREE_CODE (context) == NAMESPACE_DECL)
+    {
+      /* We can get here from typename_sub0 in the explicit_template_type
+        expansion.  Just fail.  */
+      cp_error ("no class template named `%#T' in `%#T'",
+               name, context);
+      return error_mark_node;
+    }
+
   if (! uses_template_parms (context)
       || currently_open_class (context))
     {