diff options
author | Markus Schorn | 2008-11-10 15:46:54 +0000 |
---|---|---|
committer | Markus Schorn | 2008-11-10 15:46:54 +0000 |
commit | c656d4d2ee8cd5ee992bbb46b697cdc9395a697e (patch) | |
tree | 3a17cd9e0ed4ddff76f2ad341e9b3026eff76fdd /core/org.eclipse.cdt.core.tests/resources | |
parent | e9f3d2a3a2f806cd38e999f71579c7fa5edd28d4 (diff) | |
download | org.eclipse.cdt-c656d4d2ee8cd5ee992bbb46b697cdc9395a697e.tar.gz org.eclipse.cdt-c656d4d2ee8cd5ee992bbb46b697cdc9395a697e.tar.xz org.eclipse.cdt-c656d4d2ee8cd5ee992bbb46b697cdc9395a697e.zip |
Support for exception specifications by Sebastian Moss, bug 252697
Diffstat (limited to 'core/org.eclipse.cdt.core.tests/resources')
-rw-r--r-- | core/org.eclipse.cdt.core.tests/resources/pdomtests/methodTests/inheritance.cpp | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/core/org.eclipse.cdt.core.tests/resources/pdomtests/methodTests/inheritance.cpp b/core/org.eclipse.cdt.core.tests/resources/pdomtests/methodTests/inheritance.cpp index 782139217c3..9c218bf5bce 100644 --- a/core/org.eclipse.cdt.core.tests/resources/pdomtests/methodTests/inheritance.cpp +++ b/core/org.eclipse.cdt.core.tests/resources/pdomtests/methodTests/inheritance.cpp @@ -4,30 +4,48 @@ public: virtual void inheritedMethod(); virtual void pureVirtualMethod() = 0; virtual void overriddenMethod(); - + + void noExceptionSpecMethod(); + void emptyExceptionSpecMethod() throw(); + void nonEmptyExceptionSpecMethod() throw(int); + inline int inlineMethod(); static int staticMethod(); int varArgsMethod(...); int constMethod() const; int volatileMethod() volatile; int constVolatileMethod() const volatile; - + // Here, const/volatile applies to the return value, not the method const int *notConstMethod(); volatile int *notVolatileMethod(); const volatile int *notConstVolatileMethod(); - + Class1(); virtual ~Class1() = 0; }; +struct A { + A(); + A(const A&) throw(); + ~A() throw(int); +}; + +struct B { + B() throw(); + B(const B&) throw(); + ~B() throw(double); +}; + +struct D : public A, public B {}; + class Class2 : public Class1 { public: void pureVirtualMethod(); void overriddenMethod(); void overloadedMethod(); void overloadedMethod(int p1); - + Class2(); ~Class2(); }; @@ -66,7 +84,7 @@ Class2::~Class2() { } class Class3 { - int defaultMethod(); + int defaultMethod(); private: void privateMethod(); protected: @@ -85,23 +103,23 @@ int main() { pc1->pureVirtualMethod(); pc1->pureVirtualMethod(); - + pc1->overriddenMethod(); pc1->overriddenMethod(); pc1->overriddenMethod(); c2.inheritedMethod(); pc2->inheritedMethod(); - + c2.pureVirtualMethod(); c2.pureVirtualMethod(); pc2->pureVirtualMethod(); - + c2.overriddenMethod(); c2.overriddenMethod(); c2.overriddenMethod(); pc2->overriddenMethod(); - + c2.overloadedMethod(); pc2->overloadedMethod(); |