This function (and getTypeOfMemberReference) deserve a deeper cleanup, but for the moment lets unblock a compatibility test. Fixes SR-7098 / rdar://problem/38394645