[D] Refer to the built-in Exception class using its fully-qualified name.
A C++ class called "Exception" could shadow the built-in one before, leading to compilation errors in the exception handling code. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12318 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d7cc6904c5
commit
a22df2eca9
4 changed files with 29 additions and 13 deletions
|
|
@ -16,6 +16,7 @@ endif
|
|||
TESTSUFFIX = _runme$(VERSIONSUFFIX).d
|
||||
|
||||
CPP_TEST_CASES = \
|
||||
d_exception_name \
|
||||
d_nativepointers \
|
||||
exception_partial_info
|
||||
|
||||
|
|
|
|||
15
Examples/test-suite/d_exception_name.i
Normal file
15
Examples/test-suite/d_exception_name.i
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Tests if exception handling still works in the presence of a wrapped C++
|
||||
// class called »Exception«, which could shadow the built-in Exception class.
|
||||
%module d_exception_name
|
||||
|
||||
%inline %{
|
||||
class Exception {
|
||||
Exception(int i) {}
|
||||
};
|
||||
|
||||
class Foo {
|
||||
~Foo() {}
|
||||
public:
|
||||
void bar(Exception *e) {}
|
||||
};
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue