This fixes bug 35682. When a template in instantiated with an incomplete typo corrected type an assertion can trigger if the -ferror-limit is used to reduce the number of errors. The issue can be reproduced with the following code:
#include <utility> using SetKeyType = String; std::pair<SetKeyType, int> v;
and compiled with: clang -stdlib=libc++ -ferror-limit=1 -c bug.cc
This requires the stdlib=libc++ option, without it the assertion does not trigger. Neither does it trigger when the -ferror-limit=1 is not used. The test case is based on this sample but no longer requires the -stdlib=libc++ option.