[PATCH] D52774: [PProcesssor] Filename should fall back to the written name when typo correction fails.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 2 06:29:25 PDT 2018


hokein added a comment.

In https://reviews.llvm.org/D52774#1252294, @kristina wrote:

> Could you add a regression test please? Also could you run this through a debugger and get a backtrace from a debugger instead of the crash report, it seems to be missing a few things likely from optimizations which a debugger will usually pick up. This seems to be asserting due to a duplicate element in a set.
>
> Thank you.


Thanks for the comment. The assertion is caused by inserting an empty `Filename` to `StringSet`. The typo correction code change the Filename (which will be used afterwards) even the typo correction heuristic fails (e.g. for `#include "./^"`, Filename is changed to empty, which is unexpected). The testcase is added at https://reviews.llvm.org/D52775. Unfortunately, I couldn't reproduce it with a simple clang CodeCompletion test.

As discussed offline with @sammccall, it would be better to let the author of typo correction to fix its issues (as the typo correction code is submitted recently, and maybe buggy).  The original patch fixes two issues, I rescoped the patch to make it clearer for review.


Repository:
  rC Clang

https://reviews.llvm.org/D52774





More information about the cfe-commits mailing list