From 5748f8f05b1ea9c077df9f0f3201fa7d9ec614e0 Mon Sep 17 00:00:00 2001 From: parsons Date: Mon, 14 Dec 2009 18:17:40 +0000 Subject: ChangeLogTag: Mon Dec 14 18:16:17 UTC 2009 Jeff Parsons --- modules/TAO/ChangeLog | 7 +++++++ modules/TAO/TAO_IDL/ast/ast_array.cpp | 11 ++++------- modules/TAO/TAO_IDL/ast/ast_expression.cpp | 16 ++++++++++++---- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/modules/TAO/ChangeLog b/modules/TAO/ChangeLog index 608fcb9be03..82e0cf26f18 100644 --- a/modules/TAO/ChangeLog +++ b/modules/TAO/ChangeLog @@ -1,3 +1,10 @@ +Mon Dec 14 18:16:17 UTC 2009 Jeff Parsons + + * TAO_IDL/ast/ast_expression.cpp: + * TAO_IDL/ast/ast_array.cpp: + + Completed support for template parameters as array bounds. + Fri Dec 11 19:17:52 UTC 2009 Jeff Parsons * TAO_IDL/ast/ast_sequence.cpp: diff --git a/modules/TAO/TAO_IDL/ast/ast_array.cpp b/modules/TAO/TAO_IDL/ast/ast_array.cpp index a7dcbf126c9..a474333473b 100644 --- a/modules/TAO/TAO_IDL/ast/ast_array.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_array.cpp @@ -150,16 +150,12 @@ AST_Array::compute_dims (UTL_ExprList *ds, AST_Expression::ExprType ex_type = (ph == 0 ? orig->ev ()->et : ph->info ()->const_type_); -// ================== -// TODO - still fails because of coercion in the constructor -// of 'copy' AST_Expression *copy = 0; ACE_NEW_RETURN (copy, AST_Expression (orig, ex_type), 0); -// ================ - + result[i] = copy; } @@ -239,10 +235,11 @@ void AST_Array::set_base_type (AST_Type *nbt) { this->pd_base_type = nbt; - this->is_local_ = nbt->is_local (); + AST_Decl::NodeType bnt = nbt->node_type (); - if (AST_Decl::NT_sequence == nbt->node_type ()) + if (bnt == AST_Decl::NT_sequence + || bnt == AST_Decl::NT_param_holder) { this->owns_base_type_ = true; } diff --git a/modules/TAO/TAO_IDL/ast/ast_expression.cpp b/modules/TAO/TAO_IDL/ast/ast_expression.cpp index 1bcf63a87a6..0ad50a1d3a1 100644 --- a/modules/TAO/TAO_IDL/ast/ast_expression.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_expression.cpp @@ -128,6 +128,7 @@ AST_Expression::AST_Expression (AST_Expression *v, tdef (0), param_holder_ (0) { + AST_Param_Holder *ph = v->param_holder_; this->fill_definition_details (); // If we are here because one string constant has @@ -153,12 +154,19 @@ AST_Expression::AST_Expression (AST_Expression *v, } else { - this->pd_ev = v->coerce (t); + if (ph == 0) + { + this->pd_ev = v->coerce (t); - if (this->pd_ev == 0) + if (this->pd_ev == 0) + { + idl_global->err ()->coercion_error (v, t); + } + } + else { - idl_global->err ()->coercion_error (v, - t); + this->param_holder_ = ph; + v->param_holder_ = 0; } if (0 != v->pd_n) -- cgit v1.2.1