|
Last change
on this file since d73e667 was d3cf623, checked in by Andrew Beach <ajbeach@…>, 10 months ago |
|
Solved the requested warning with exceptions. Also went through the exceptions tests and managed to remove about 2/3rds of them from the lax list that now either didn't have any warnings or warnings because of the test itself.
|
-
Property mode
set to
100644
|
|
File size:
469 bytes
|
| Line | |
|---|
| 1 | // Make sure throw-catch during unwind does not trash internal data.
|
|---|
| 2 |
|
|---|
| 3 | #include <fstream.hfa>
|
|---|
| 4 |
|
|---|
| 5 | exception yin {};
|
|---|
| 6 | exception yang {};
|
|---|
| 7 |
|
|---|
| 8 | vtable(yin) yin_vt;
|
|---|
| 9 | vtable(yang) yang_vt;
|
|---|
| 10 |
|
|---|
| 11 | int main() {
|
|---|
| 12 | try {
|
|---|
| 13 | try {
|
|---|
| 14 | throw (yin){&yin_vt};
|
|---|
| 15 | } finally {
|
|---|
| 16 | try {
|
|---|
| 17 | throw (yang){&yang_vt};
|
|---|
| 18 | } catch (yin *) {
|
|---|
| 19 | sout | "inner yin";
|
|---|
| 20 | } catch (yang *) {
|
|---|
| 21 | sout | "inner yang";
|
|---|
| 22 | }
|
|---|
| 23 | }
|
|---|
| 24 | } catch (yin *) {
|
|---|
| 25 | sout | "outer yin";
|
|---|
| 26 | } catch (yang *) {
|
|---|
| 27 | sout | "outer yang";
|
|---|
| 28 | }
|
|---|
| 29 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.