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:
parent
cf527173cd
commit
4b79eb9219
5 changed files with 107 additions and 18 deletions
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
%}
|
||||
|
|
|
|||
22
Examples/test-suite/nested_structs.i
Normal file
22
Examples/test-suite/nested_structs.i
Normal 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
|
||||
};
|
||||
%}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue