Fixed [ 836903 ] C++ inconsistency (with void arguments).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5398 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d17b4065ce
commit
c3eab02d6d
2 changed files with 23 additions and 0 deletions
|
|
@ -297,11 +297,16 @@ static String *name_warning(String *name,SwigType *decl) {
|
|||
/* Add declaration list to symbol table */
|
||||
static int add_only_one = 0;
|
||||
|
||||
extern void cparse_normalize_void(Node *);
|
||||
|
||||
static void add_symbols(Node *n) {
|
||||
String *decl;
|
||||
String *wrn = 0;
|
||||
|
||||
if (inclass) {
|
||||
cparse_normalize_void(n);
|
||||
}
|
||||
|
||||
/* Don't add symbols for private/protected members */
|
||||
if (inclass && (cplus_mode != CPLUS_PUBLIC)) {
|
||||
while (n) {
|
||||
|
|
|
|||
|
|
@ -69,3 +69,21 @@ void Swig_cparse_replace_descriptor(String *s) {
|
|||
}
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* cparse_normalize_void()
|
||||
*
|
||||
* This function is used to replace arguments of the form (void) with empty
|
||||
* arguments in C++
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void cparse_normalize_void(Node *n) {
|
||||
String *decl = Getattr(n,"decl");
|
||||
Parm *parms = Getattr(n,"parms");
|
||||
|
||||
if (SwigType_isfunction(decl)) {
|
||||
if ((ParmList_len(parms) == 1) && (SwigType_type(Getattr(parms,"type")) == T_VOID)) {
|
||||
Replaceall(decl,"f(void).","f().");
|
||||
Delattr(n,"parms");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue