Add inheritance overlap test
Fix template inheritance overlap