From 0fb9f1c39b7a4ad17bbdacaab965df67daf4c7c5 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sun, 7 Dec 1997 19:33:08 -0500 Subject: [PATCH] error.c (dump_decl): Handle LOOKUP_EXPR. * error.c (dump_decl): Handle LOOKUP_EXPR. Sun Dec 7 15:45:07 1997 Mark Mitchell * 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 | 15 +++++++++++++++ gcc/cp/error.c | 4 ++++ gcc/cp/pt.c | 6 ++++-- gcc/cp/rtti.c | 2 +- gcc/cp/typeck.c | 9 ++++++--- 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2d01038dfcb..d2049dfd230 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,18 @@ +Sun Dec 7 15:53:06 1997 Jason Merrill + + * error.c (dump_decl): Handle LOOKUP_EXPR. + +Sun Dec 7 15:45:07 1997 Mark Mitchell + + * 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 * typeck.c (build_binary_op_nodefault, pointer_diff): Symmetric diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 206474130cd..016573dfc87 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -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; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index ec581d58737..f9f501728b5 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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, diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 49406962722..18d45ba69cb 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -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)); } diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 2739333e533..1edd1bbaff2 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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; }