﻿id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc
296	Forgetting an exception vtable gives runtime crash	mlbrooks		"{{{

#if defined WITH_USER_FIX
#define UFIX(...) __VA_ARGS__ // user adds this code, after understanding what the problem is
#else
#define UFIX(...)
#endif

exception E {};
UFIX( vtable(E) E_vt; )
int main() {
	try {
		throw (E){ UFIX( & E_vt ) };
	} catch ( E * ) {
	}
	printf( ""done\n"" );
	return 0;
}
}}}

Actual: Runtime error, segment fault at memory location near zero

Expected: Compile warning or error, indicating cannot throw `(E){}`

`-DWITH_USER_FIX`, actual and expected: print ""done""

Note that a user learning CFA exceptions is likely to forget either a manual vtable declaration or to use Exception.hfa.  Such a user is not well equipped to understand that the segment fault means the vtable is missing.

Mike would be satisfied by handling the problem case as:  Error, no default ctor for E.  Others may disagree.
"	defect	new	minor	cfa-cc	1.0		exception vtable	
