Previously we would call getAsTemplate() when kind == TemplateExpansion,
which triggers an assertion. The call is now replaced with
getAsTemplateOrTemplatePattern(), which is exactly the same as
getAsTemplate(), except it allows calls when kind == TemplateExpansion.
No change in behavior for no-assert builds.
The Flags.clear() in the previous cases is a leftover from when we used to do Flags = {"-fno-delayed-template-parsing"}; to get the test to pass on Windows. That has since been removed (it's set directly by TestTU), so the Flags.clear() is no longer necessary.