From b19d506db7efcc50ee0512fdb747bb5e5f3bcde3 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Tue, 5 May 2015 18:06:04 +1200 Subject: [PATCH] Suppress warning 325 "Nested class not currently supported (Foo ignored)" when Foo has already been explicitly ignored with "%ignore". --- CHANGES.current | 4 ++++ Examples/test-suite/errors/cpp_macro_locator.i | 7 ++++++- Source/CParse/parser.y | 14 ++++++-------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index 3bc2a950b..58905c6dd 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,10 @@ See the RELEASENOTES file for a summary of changes in each release. Version 3.0.6 (in progress) =========================== +2015-05-05: olly + Suppress warning 325 "Nested class not currently supported (Foo + ignored)" when Foo has already been explicitly ignored with "%ignore". + 2015-05-04: wsfulton Add support for friend templates, including operator overloading - fixes #196. Considering the example below, previously the operator gave a syntax error and friendfunc incorrectly diff --git a/Examples/test-suite/errors/cpp_macro_locator.i b/Examples/test-suite/errors/cpp_macro_locator.i index bd441a121..e00caf00d 100644 --- a/Examples/test-suite/errors/cpp_macro_locator.i +++ b/Examples/test-suite/errors/cpp_macro_locator.i @@ -100,4 +100,9 @@ void overloadinline2(const int *) {} void overload5(int *) {} void overload5(const int *) {} - +%ignore Outer2::QuietInner; +struct Outer2 { + struct QuietInner { + VARIABLEMACRO(MyInnerVar) + }; +}; diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 30b0edfe2..c8dc44a79 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -977,7 +977,6 @@ static void update_nested_classes(Node *n) static Node *nested_forward_declaration(const char *storage, const char *kind, String *sname, String *name, Node *cpp_opt_declarators) { Node *nn = 0; - int warned = 0; if (sname) { /* Add forward declaration of the nested type */ @@ -1021,13 +1020,12 @@ static Node *nested_forward_declaration(const char *storage, const char *kind, S if (!currentOuterClass || !GetFlag(currentOuterClass, "nested")) { if (nn && Equal(nodeType(nn), "classforward")) { Node *n = nn; - SWIG_WARN_NODE_BEGIN(n); - Swig_warning(WARN_PARSE_NAMED_NESTED_CLASS, cparse_file, cparse_line,"Nested %s not currently supported (%s ignored)\n", kind, sname ? sname : name); - SWIG_WARN_NODE_END(n); - warned = 1; - } - - if (!warned) { + if (!GetFlag(n, "feature:ignore")) { + SWIG_WARN_NODE_BEGIN(n); + Swig_warning(WARN_PARSE_NAMED_NESTED_CLASS, cparse_file, cparse_line,"Nested %s not currently supported (%s ignored)\n", kind, sname ? sname : name); + SWIG_WARN_NODE_END(n); + } + } else { Swig_warning(WARN_PARSE_UNNAMED_NESTED_CLASS, cparse_file, cparse_line, "Nested %s not currently supported (ignored).\n", kind); } }