This is about as simplified as I could make a toy example that still hit the bug:
struct Vector3f64 { double x; double y; double z; }; struct Vector3f32 {
As workaround, you might simply do:
template auto func(const T& dir) -> decltype(VectorVolume(dir.x, dir.y, dir.z)) { return VectorVolume(dir.x, dir.y, dir.z); }