error.c (dump_decl): Handle LOOKUP_EXPR.
authorJason Merrill <jason@gcc.gnu.org>
Mon, 8 Dec 1997 00:33:08 +0000 (19:33 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 8 Dec 1997 00:33:08 +0000 (19:33 -0500)
* error.c (dump_decl): Handle LOOKUP_EXPR.

Sun Dec  7 15:45:07 1997  Mark Mitchell  <mmitchell@usa.net>

* rtti.c (build_dynamic_cast): Copy the cast-to type to the
permanent obstack if we are processing a template decl.
* typeck.c (build_static_cast): Likewise.
(build_const_cast): Likewise.
(build_reinterpret_cast): Likewise.

* pt.c (coerce_template_parms): Coerce some expressions, even
when processing_template_decl.

From-SVN: r17001

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/cp/pt.c
gcc/cp/rtti.c
gcc/cp/typeck.c

index 2d01038dfcba2f56ddd57c3fb09edb4187165d81..d2049dfd23082bbe22756e5f3b1cc1f3de81701b 100644 (file)
@@ -1,3 +1,18 @@
+Sun Dec  7 15:53:06 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * error.c (dump_decl): Handle LOOKUP_EXPR.
+
+Sun Dec  7 15:45:07 1997  Mark Mitchell  <mmitchell@usa.net>
+
+       * rtti.c (build_dynamic_cast): Copy the cast-to type to the
+       permanent obstack if we are processing a template decl.
+       * typeck.c (build_static_cast): Likewise.
+       (build_const_cast): Likewise.
+       (build_reinterpret_cast): Likewise.
+
+       * pt.c (coerce_template_parms): Coerce some expressions, even
+       when processing_template_decl.
+
 Sun Dec  7 01:46:33 1997  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
 
        * typeck.c (build_binary_op_nodefault, pointer_diff): Symmetric
index 206474130cd4efd7506860e30942ac330b5ec6ac..016573dfc871fa75d8888bc4b90d1172936d2514 100644 (file)
@@ -797,6 +797,10 @@ dump_decl (t, v)
       }
       break;
 
+    case LOOKUP_EXPR:
+      OB_PUTID (TREE_OPERAND (t, 0));
+      break;
+
     case LABEL_DECL:
       OB_PUTID (DECL_NAME (t));
       break;
index ec581d5873786c5579b1142f2e77d1b1308965e9..f9f501728b5472dcdc1254d605b5540b57454eb0 100644 (file)
@@ -1075,12 +1075,14 @@ coerce_template_parms (parms, arglist, in_decl)
        {
          tree t = tsubst (TREE_TYPE (parm), vec,
                           TREE_VEC_LENGTH (vec), in_decl);
-         if (processing_template_decl)
+         if (processing_template_decl && 
+             (uses_template_parms (arg) || uses_template_parms (t)))
            val = arg;
          else
            val = digest_init (t, arg, (tree *) 0);
 
-         if (val == error_mark_node || processing_template_decl)
+         if (val == error_mark_node 
+             || (processing_template_decl && uses_template_parms (val)))
            ;
 
          /* 14.2: Other template-arguments must be constant-expressions,
index 4940696272292288acdd0e14c45aa8e18a8494f9..18d45ba69cb62cf2b906064e407e12c1b263fb44 100644 (file)
@@ -642,7 +642,7 @@ build_dynamic_cast (type, expr)
     return error_mark_node;
   
   if (processing_template_decl)
-    return build_min (DYNAMIC_CAST_EXPR, type, expr);
+    return build_min (DYNAMIC_CAST_EXPR, copy_to_permanent (type), expr);
 
   return convert_from_reference (build_dynamic_cast_1 (type, expr));
 }
index 2739333e5338490a21acdfc2bf86f49752f7eade..1edd1bbaff20c1e3ee460b293800b441fd61bec3 100644 (file)
@@ -5264,7 +5264,8 @@ build_static_cast (type, expr)
 
   if (processing_template_decl)
     {
-      tree t = build_min (STATIC_CAST_EXPR, type, expr);
+      tree t = build_min (STATIC_CAST_EXPR, copy_to_permanent (type),
+                         expr); 
       return t;
     }
 
@@ -5356,7 +5357,8 @@ build_reinterpret_cast (type, expr)
 
   if (processing_template_decl)
     {
-      tree t = build_min (REINTERPRET_CAST_EXPR, type, expr);
+      tree t = build_min (REINTERPRET_CAST_EXPR, 
+                         copy_to_permanent (type), expr);
       return t;
     }
 
@@ -5456,7 +5458,8 @@ build_const_cast (type, expr)
 
   if (processing_template_decl)
     {
-      tree t = build_min (CONST_CAST_EXPR, type, expr);
+      tree t = build_min (CONST_CAST_EXPR, copy_to_permanent (type),
+                         expr);
       return t;
     }