As per comments on GetFilename() in MCReferencedImageRep... You don't need to use an auto-class here, and can just make it:
```
if (t_rep -> GetType() == kMCImageRepReferenced && MCStringIsEqualTo(static_cast<MCReferencedImageRep*>(t_rep)->GetFilename(), *t_filename, kMCStringOptionCompareExact)