Post D96572, a warning started showing up for me:
clang/lib/Basic/Sanitizers.cpp:73:1: warning: control reaches end of non-void function [-Wreturn-type]
So this adds a default to the case to return invalid, which seems appropriate,
and appears to correct the issue.
clang-tidy: warning: default label in switch which covers all enumeration values [clang-diagnostic-covered-switch-default]
not useful