// Test exceptions that add data but no functionality. #include DATA_EXCEPTION(paired)( int first; int second; ); void ?{}(paired & this, int first, int second) { VTABLE_INIT(this, paired); this.first = first; this.second = second; } const char * paired_msg(paired * this) { return "paired"; } VTABLE_INSTANCE(paired)(paired_msg); void throwPaired(int first, int second) { paired exc = {first, second}; } int main(int argc, char * argv[]) { paired except = {3, 13}; try { throw except; } catch (paired * exc) { printf("%s(%d, %d)\n", paired_msg(exc), exc->first, exc->second); ++exc->first; } printf("%s(%d, %d)\n", paired_msg(&except), except.first, except.second); try { throwResume except; } catchResume (paired * exc) { printf("%s(%d, %d)\n", paired_msg(exc), exc->first, exc->second); ++exc->first; } printf("%s(%d, %d)\n", paired_msg(&except), except.first, except.second); }