When suggesting "foo::bar" as a correction for "fob::bar" we
mistakenly replaced only "bar" with "foo::bar" producing
"fob::foo::bar" which was broken.

This corrects that replacement in as many places as I could find &
provides test cases for all those cases I could find a test case for.
There are a couple that don't seem to be reachable (one looks entirely
dead, the other just doesn't seem to ever get called with a namespace
to namespace change).


If anyone knows of ways to test these cases I didn't git - or wants to
kill them off, that'd be great.
Also, I'm open to suggestions/ideas on where to store the SourceRange
& how to propagate it. I realize the current implementation (of
calling "setCorrectionRange" (& passing in a CXXScopeSpec and
DeclarationNameInfo) is perhaps a bit rough - alternatives include
passing the information down through more layers so that the
TypoCorrections can be constructed with this information from the
get-go, or wrapping "CorrectTypo" in an outer function that adds the
source range so that if someone adds another non-empty return from
CorrectTypo they don't accidentally fail to add the source range
information))
We could also use the correction range for /all/ correction
replacements just for consistency, but for now I just focused on any
correction fixit that included an CXXScopeSpec range in the
diagnostic.

Thanks,
- David

Attachment: qualified_typo.diff
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to