diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/cp/error.c | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 6 | ||||
-rw-r--r-- | gcc/cp/rtti.c | 2 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 9 |
5 files changed, 30 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2d01038..d2049df 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 2064741..016573d 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 ec581d5..f9f5017 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 4940696..18d45ba 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 2739333..1edd1bb 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; } |