HomePhabricator

[Sema][Typo] Fix assertion failure for expressions with multiple typos

Description

[Sema][Typo] Fix assertion failure for expressions with multiple typos

Summary:
As Typo Resolution can create new TypoExprs while resolving typos,
it is necessary to recurse through the expression to search for more
typos.

This should fix the assertion failure in clang::Sema::~Sema():

`DelayedTypos.empty() && "Uncorrected typos!"`

Notes:

  • In case some TypoExprs are created but thrown away, Sema now has a Vector that is used to keep track of newly created typos.
  • For expressions with multiple typos, we only give suggestions if we are able to resolve all typos in the expression
  • This patch is similar to D37521 except that it does not eagerly commit to a correction for the first typo in the expression. Instead, it will search for corrections which fix all of the typos in the expression.

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D62648

Details

Committed
dgoldmanAug 20 2019, 12:03 PM
Differential Revision
D62648: [Sema][Typo] Fix assertion failure for expressions with multiple typos
Branches
Unknown
Tags
Unknown