From bca2bc8b00b143e935134cb87f6b5d01d4da38f4 Mon Sep 17 00:00:00 2001 From: parsons Date: Wed, 8 Dec 2010 03:22:41 +0000 Subject: ChangeLogTag: Wed Dec 8 03:13:28 UTC 2010 Jeff Parsons --- TAO/ChangeLog | 8 ++++++++ TAO/TAO_IDL/fe/fe_utils.cpp | 15 +++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 094cc2c7a71..f48b43a2f5e 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,11 @@ +Wed Dec 8 03:13:28 UTC 2010 Jeff Parsons + + * TAO_IDL/fe/fe_utils.cpp(can_be_redefined): + + Modified the method to return 'false' if either of its 2 + arguments is a template module. Such a return will + cause a redefinition error to be output. + Tue Dec 7 22:10:52 UTC 2010 Jeff Parsons * TAO_IDL/be/be_codegen.cpp: diff --git a/TAO/TAO_IDL/fe/fe_utils.cpp b/TAO/TAO_IDL/fe/fe_utils.cpp index 4114e9fe472..892a9ce5a28 100644 --- a/TAO/TAO_IDL/fe/fe_utils.cpp +++ b/TAO/TAO_IDL/fe/fe_utils.cpp @@ -10,6 +10,7 @@ #include "ast_structure.h" #include "ast_valuetype.h" #include "ast_sequence.h" +#include "ast_template_module.h" #include "global_extern.h" @@ -839,6 +840,8 @@ FE_Utils::can_be_redefined (AST_Decl *prev_decl, AST_StructureFwd *s_fwd = 0; AST_Interface *i = 0; AST_InterfaceFwd *i_fwd = 0; + AST_Template_Module *ptm = 0; + AST_Template_Module *ctm = 0; bool nt_eq = (pnt == cnt); bool s_eq = (prev_scope == curr_scope); @@ -846,8 +849,16 @@ FE_Utils::can_be_redefined (AST_Decl *prev_decl, switch (pnt) { case AST_Decl::NT_module: - /// Just need to check that both are modules. - return (cnt == AST_Decl::NT_module); + /// Need to check that both are modules. + if (cnt != AST_Decl::NT_module) + { + return false; + } + + /// Neither can be a template module. + ptm = AST_Template_Module::narrow_from_decl (prev_decl); + ctm = AST_Template_Module::narrow_from_decl (curr_decl); + return (ptm == 0 && ctm == 0); /// For the *_fwd types, if scopes aren't related, it's ok. /// If they are related, then we need another fwd or a full decl. case AST_Decl::NT_component_fwd: -- cgit v1.2.1