Merge master and C++11 strongly typed enum support

Merging from master:
* 'master' of github.com:/swig/swig:
  Add more docs about _global_ prefix in typemap temporary variables
  Add clarification on _global_ prefix.
  fix for nested template defined out of class (issue #265)
  using an unknown constant emits a notice, not a warning
  Fix typo
  Consistently put whitespace outside of <tt>...</tt> and not inside
  wording tweak
  Go: Document memory management of C++ classes allocated in Go.  Fixes #266.
  revert unrelated file
  Fix #224
  Fixes for clang -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error
  delete unmeaningful macro
  Go: fix overload functions with polymorphic issue
  del tmp files
  GoLang:fix overload functions with polymorphic issue
This commit is contained in:
William S Fulton 2014-12-07 17:33:16 +00:00
commit b9b9b3cd21
18 changed files with 157 additions and 42 deletions

View file

@ -311,6 +311,7 @@ CPP_TEST_CASES += \
overload_extend \
overload_method \
overload_numeric \
overload_polymorphic \
overload_rename \
overload_return_type \
overload_simple \

View file

@ -0,0 +1,11 @@
package main
import "./overload_polymorphic"
func main(){
t := overload_polymorphic.NewDerived()
if overload_polymorphic.Test(t) != 0 {
panic("failed")
}
}

View file

@ -31,10 +31,34 @@ namespace ns {
struct Nested1;
public:
struct Nested2;
template <class T> class Abstract;
class Real;
};
struct Outer1::Nested2 {
int data;
};
class Class {
public:
template <class T> class Abstract;
class Real;
};
template <class T> class Class::Abstract {
public:
virtual void Method() = 0;
};
#endif
%}
#ifndef __clang__
%template(abstract_int) Class::Abstract <int>;
#endif
%inline %{
#ifndef __clang__
class Class::Real : public Abstract <int> {
public:
virtual void Method() {}
};
#endif
%}

View file

@ -0,0 +1,22 @@
%module overload_polymorphic
%inline %{
class Base {
public:
Base(){}
virtual ~Base(){}
};
class Derived : public Base {
public:
Derived(){}
virtual ~Derived(){}
};
int test(Base* base){ return 0;}
int test(int hello){ return 1; }
%}