[PATCH] D47341: [Sema] Disable creating new delayed typos while correcting existing.

2018-05-28 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a comment. Some debugging details that can be useful but too specific for the commit message. When we have infinite loop, the steps are: 1. Detect typos `structVar1`, `structVar2` 2. Correct typos `structVar1`, `structVar2` 1. Replace `structVar1` with `structVar`. Add correspond

[PATCH] D47341: [Sema] Disable creating new delayed typos while correcting existing.

2018-05-28 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai updated this revision to Diff 148841. vsapsai added a comment. - Fix only infinite loop and don't touch the assertion failure. New commit message should be: [Sema] Fix infinite typo correction loop. NumTypos guard value ~0U doesn't prevent from creating new delayed typos. When you creat

[PATCH] D47341: [Sema] Disable creating new delayed typos while correcting existing.

2018-05-25 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai planned changes to this revision. vsapsai added a comment. After looking into this more, I think there are 2 different bugs: one with infinite loop and another with `DelayedTypos.empty() && "Uncorrected typos!"` assertion. And disabling typo correction happened to fix both of them. Infi

[PATCH] D47341: [Sema] Disable creating new delayed typos while correcting existing.

2018-05-24 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. Rather than disabling typo correction in `TransformTypos`, it would be preferable to attempt to immediately correct them. (That should allow the `variableX.getX()` case to still work.) https://reviews.llvm.org/D47341 ___ cf

[PATCH] D47341: [Sema] Disable creating new delayed typos while correcting existing.

2018-05-24 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: clang/test/SemaCXX/typo-correction-delayed.cpp:146 + // expected-error@+1 {{use of undeclared identifier 'variableX'}} int x = variableX.getX(); } Loosing typo correction for 'getX' is fine, however, I think we sti

[PATCH] D47341: [Sema] Disable creating new delayed typos while correcting existing.

2018-05-24 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai created this revision. vsapsai added reviewers: arphaman, majnemer. NumTypos guard value ~0U doesn't prevent from creating new delayed typos. When you create new delayed typos during typo correction, value ~0U wraps around to 0. This state is inconsistent and depending on total number of t