At times, gcc
yields the following error message:
error: 'class X' has no member named 'Y'; did you mean 'Z'?
I have seen gcc
correctly guess Z
when Y
contains some simple typo, e.g. wrong lower/upper case, but also when there are some missing/extra character(s) in the name.
I was curious to know
gcc
correctly guess Z
starting from Y
?I would welcome answers relating other compilers too, if they perform something ostensibly different or interesting.
Well after a quick search it seems that GCC has an internal code to handle spellcheck which includes an implementation of Levenstein distance.
see https://gcc.gnu.org/ml/gcc-patches/2015-09/msg01090.html and https://gcc.gnu.org/ml/gcc-patches/2015-11/msg00046.html