Fixed [ 836903 ] C++ inconsistency (with void arguments).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5398 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5a74e5a4a2
commit
e7c45edd39
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 */
|
/* Add declaration list to symbol table */
|
||||||
static int add_only_one = 0;
|
static int add_only_one = 0;
|
||||||
|
|
||||||
|
extern void cparse_normalize_void(Node *);
|
||||||
|
|
||||||
static void add_symbols(Node *n) {
|
static void add_symbols(Node *n) {
|
||||||
String *decl;
|
String *decl;
|
||||||
String *wrn = 0;
|
String *wrn = 0;
|
||||||
|
|
||||||
|
if (inclass) {
|
||||||
|
cparse_normalize_void(n);
|
||||||
|
}
|
||||||
|
|
||||||
/* Don't add symbols for private/protected members */
|
/* Don't add symbols for private/protected members */
|
||||||
if (inclass && (cplus_mode != CPLUS_PUBLIC)) {
|
if (inclass && (cplus_mode != CPLUS_PUBLIC)) {
|
||||||
while (n) {
|
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