From 9a0a04303dc583e2d1d316d4fc8bd36ef8535ab7 Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Tue, 25 Nov 2003 19:27:17 +0000 Subject: [PATCH] [ 756552 ] missing default argument class scope with "|" git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5403 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/CParse/parser.y | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index b10d58b91..38cf6d720 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -4312,12 +4312,18 @@ expr : exprnum { $$ = $1; } /* Check if value is in scope */ n = Swig_symbol_clookup($1,0); if (n) { - if (Getattr(n,"access")) { - if (cplus_mode == CPLUS_PUBLIC) { - Swig_warning(WARN_PARSE_PRIVATE,cparse_file, cparse_line, "'%s' is private in this context.\n", $1); - $$.type = T_ERROR; + if (Getattr(n,"access") && (cplus_mode == CPLUS_PUBLIC)) { + Swig_warning(WARN_PARSE_PRIVATE,cparse_file, cparse_line, "'%s' is private in this context.\n", $1); + $$.type = T_ERROR; + } else { + /* A band-aid for enum values used in expressions. */ + if (Strcmp(nodeType(n),"enumitem") == 0) { + String *q = Swig_symbol_qualified(n); + if (q) { + $$.val = NewStringf("%s::%s", q, Getattr(n,"name")); + Delete(q); + } } - } } }