Apply patch from Kalyanov Dmitry which fixes parsing of nested structs containing comments

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10981 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2008-12-12 21:31:21 +00:00
commit 4b79eb9219
5 changed files with 107 additions and 18 deletions

View file

@ -79,7 +79,7 @@ CPP_TEST_BROKEN += \
extend_variable \
li_std_vector_ptr \
namespace_union \
nested_comment \
nested_struct \
overload_complicated \
template_default_pointer \
template_expr
@ -235,6 +235,7 @@ CPP_TEST_CASES += \
namespace_typemap \
namespace_virtual_method \
naturalvar \
nested_comment \
newobject1 \
null_pointer \
operator_overload \

View file

@ -18,24 +18,17 @@ in rlgc models */
char *name;
} n ;
} s2;
%}
// bug #491476
// comment in nested struct
%inline %{
struct {
struct {
int a;
} a, b;
} a;
%}
// bug #909387
%inline %{
struct foo {
struct happy; // no warning
struct sad { int x; }; // warning
happy *good(); // produces good code
sad *bad(); // produces bad code
struct a
{
struct {
/*struct*/
struct {
int b;
} c;
} d;
};
%}

View file

@ -0,0 +1,22 @@
%module nested_structs
// bug #491476
%inline %{
struct {
struct {
int a;
} a, b;
} a;
%}
// bug #909387
%inline %{
struct foo {
struct happy; // no warning
struct sad { int x; }; // warning
happy *good(); // produces good code
sad *bad(); // produces bad code
};
%}