diff options
Diffstat (limited to 'TAO/TAO_IDL/ast/ast_interface.cpp')
-rw-r--r-- | TAO/TAO_IDL/ast/ast_interface.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/TAO/TAO_IDL/ast/ast_interface.cpp b/TAO/TAO_IDL/ast/ast_interface.cpp index 82d739e03b3..76e6a6fe118 100644 --- a/TAO/TAO_IDL/ast/ast_interface.cpp +++ b/TAO/TAO_IDL/ast/ast_interface.cpp @@ -1031,6 +1031,25 @@ AST_Interface::fwd_redefinition_helper (AST_Interface *&i, return; } + UTL_Scope *scope = i->defined_in (); + const char *prefix_holder = 0; + + // If our prefix is empty, we check to see if an ancestor has one. + while (ACE_OS::strcmp (i->prefix (), "") == 0 && scope != 0) + { + AST_Decl *parent = ScopeAsDecl (scope); + prefix_holder = parent->prefix (); + + // We have reached global scope. + if (prefix_holder == 0) + { + break; + } + + i->prefix (ACE_const_cast (char *, prefix_holder)); + scope = parent->defined_in (); + } + // Fwd redefinition should be in the same scope, so local // lookup is all that's needed. AST_Decl *d = s->lookup_by_name_local (i->local_name (), @@ -1040,6 +1059,24 @@ AST_Interface::fwd_redefinition_helper (AST_Interface *&i, if (d != 0) { + scope = d->defined_in (); + + // If the lookup prefix is empty, we check to see if an ancestor has one. + while (ACE_OS::strcmp (d->prefix (), "") == 0 && scope != 0) + { + AST_Decl *parent = ScopeAsDecl (scope); + prefix_holder = parent->prefix (); + + // We have reached global scope. + if (prefix_holder == 0) + { + break; + } + + d->prefix (ACE_const_cast (char *, prefix_holder)); + scope = parent->defined_in (); + } + // Full definition must have the same prefix as the forward declaration. if (ACE_OS::strcmp (i->prefix (), d->prefix ()) != 0) { |