Can you file a new bug or modify the upstream one to audit existing uses of getTemplateInstantiationPattern() (and maybe related functions)?
getSpecializedTemplate() is used with no null check in findTarget and xrefs, and I'm sure related cases are around too.
I think "Template may not be instantiated e.g. if the type didn't need to be complete; fallback to primary template." might be enough of a comment here
make these comments meaningful
Can you add a comment about what specifically this is testing?
Unit tests: fail. 62158 tests passed, 5 failed and 811 were skipped.
failed: libc++.std/language_support/cmp/cmp_partialord/partialord.pass.cpp failed: libc++.std/language_support/cmp/cmp_strongeq/cmp.strongeq.pass.cpp failed: libc++.std/language_support/cmp/cmp_strongord/strongord.pass.cpp failed: libc++.std/language_support/cmp/cmp_weakeq/cmp.weakeq.pass.cpp failed: libc++.std/language_support/cmp/cmp_weakord/weakord.pass.cpp