Currently in Sema::getDestructorName we call SS.getScopeRep()->getPrefix() but SS.getScopeRep() can return nullptr because LookupInNestedNameSpec(...) called a little before can invalidate SS.
This fixes: https://github.com/llvm/llvm-project/issues/59446
CXXScopeSpec::isSet() is apparently (intended to be) deprecated.
clang/include/clang/Sema/DeclSpec.h: 209 /// Deprecated. Some call sites intend isNotEmpty() while others intend 210 /// isValid(). 211 bool isSet() const { return getScopeRep() != nullptr; }It sounds like this should instead call .isValid() or .isNotEmpty(), but I'm not sure which.