Skip to content

Commit

Permalink
out-of-scope template definitions fixed
Browse files Browse the repository at this point in the history
nested_private test disabled again
  • Loading branch information
wkalinin committed Dec 4, 2013
1 parent e1a4e11 commit 053c605
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Examples/test-suite/common.mk
Expand Up @@ -84,6 +84,7 @@ CPP_TEST_BROKEN += \
extend_variable \
li_std_vector_ptr \
li_boost_shared_ptr_template \
nested_private \
overload_complicated \
template_default_pointer \
template_expr \
Expand Down Expand Up @@ -278,7 +279,6 @@ CPP_TEST_CASES += \
naturalvar_more \
nested_class \
nested_comment \
nested_private \
nested_scope \
nested_workaround \
newobject1 \
Expand Down
16 changes: 13 additions & 3 deletions Source/CParse/parser.y
Expand Up @@ -3389,6 +3389,7 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE {
scope = resolve_create_node_scope($3);
/* save nscope_inner to the class - it may be overwritten in nested classes*/
Setattr($<node>$, "nested:innerscope", nscope_inner);
Setattr($<node>$, "nested:nscope", nscope);
Setfile(scope,cparse_file);
Setline(scope,cparse_line);
$3 = scope;
Expand Down Expand Up @@ -3465,8 +3466,10 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE {
$$ = currentOuterClass;
currentOuterClass = Getattr($$, "nested:outer");
nscope_inner = Getattr($<node>$, "nested:innerscope");
nscope = Getattr($<node>$, "nested:nscope");
Delattr($<node>$, "nested:innerscope");
if (nscope_inner) /*actual parent class for this class*/
Delattr($<node>$, "nested:nscope");
if (nscope_inner && Strcmp(nodeType(nscope_inner), "class") == 0) /* actual parent class for this class */
Setattr($$, "nested:outer", nscope_inner);
if (!currentOuterClass)
inclass = 0;
Expand Down Expand Up @@ -3546,14 +3549,21 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE {
Swig_symbol_setscope(Getattr(nscope_inner,"symtab"));
Delete(Namespaceprefix);
Namespaceprefix = Swig_symbol_qualifiedscopename(0);
yyrename = Copy(Getattr($<node>$, "class_rename"));
add_symbols($$);
Delattr($$, "class_rename");
/* but the variable definition in the current scope */
Swig_symbol_setscope(cscope);
Delete(Namespaceprefix);
Namespaceprefix = Swig_symbol_qualifiedscopename(0);
add_symbols($9);
nscope_inner = 0;
$$ = $9;
if (nscope) {
$$ = nscope;
if ($9)
appendSibling($$, $9);
}
else if (!SwigType_istemplate(ty) && template_parameters == 0)
$$ = $9;
} else {
Delete(yyrename);
yyrename = 0;
Expand Down

0 comments on commit 053c605

Please sign in to comment.