From 0286f6d43ef126e2d68354fbdf33cb276083a7a1 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sun, 15 Nov 2009 00:36:22 +0000 Subject: [PATCH] Fix #1960977 - Syntax error parsing derived nested class declaration and member variable instance git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11748 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CHANGES.current | 4 ++++ Examples/test-suite/derived_nested.i | 2 ++ Source/CParse/parser.y | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.current b/CHANGES.current index 8469fa815..3d5c27950 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,6 +1,10 @@ Version 1.3.41 (in progress) ============================ +2009-11-15: wsfulton + Fix #1960977 - Syntax error parsing derived nested class declaration and member + variable instance. + 2009-11-14: wsfulton Fix #2310483 - function pointer typedef within extern "C" block. diff --git a/Examples/test-suite/derived_nested.i b/Examples/test-suite/derived_nested.i index 9a7cfce07..29114d5a0 100644 --- a/Examples/test-suite/derived_nested.i +++ b/Examples/test-suite/derived_nested.i @@ -6,6 +6,7 @@ This was reported in bug #909389 */ %warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) BB::CC; %warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) BB::DD; %warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) BB::EE; +%warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) BB::FF; %inline %{ @@ -19,6 +20,7 @@ struct BB { class CC { int y; }; class DD : public A { int z; }; struct EE : public A { int z; }; + struct FF : public A { int z; } ff_instance; // Bug 1960977 void useEE(const EE& e) {} }; %} diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index f78d5255b..b87ba9368 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -4483,7 +4483,7 @@ cpp_nested : storage_class cpptype ID LBRACE { cparse_start_line = cparse_line /* This adds one shift/reduce. */ | storage_class cpptype idcolon COLON base_list LBRACE { cparse_start_line = cparse_line; skip_balanced('{','}'); - } SEMI { + } cpp_opt_declarators { $$ = 0; if (cplus_mode == CPLUS_PUBLIC) { $$ = nested_forward_declaration($2, $3);