// with the same edit length that pass all the checks and filters.
// TODO: Properly handle various permutations of possible corrections when
// there is more than one potentially ambiguous typo correction.
+ // Also, disable typo correction while attempting the transform when
+ // handling potentially ambiguous typo corrections as any new TypoExprs will
+ // have been introduced by the application of one of the correction
+ // candidates and add little to no value if corrected.
+ SemaRef.DisableTypoCorrection = true;
while (!AmbiguousTypoExprs.empty()) {
auto TE = AmbiguousTypoExprs.back();
auto Cached = TransformCache[TE];
State.Consumer->restoreSavedPosition();
TransformCache[TE] = Cached;
}
+ SemaRef.DisableTypoCorrection = false;
// Ensure that all of the TypoExprs within the current Expr have been found.
if (!Res.isUsable())
}
}
}
+
+namespace NewTypoExprFromResolvingTypoAmbiguity {
+struct A {
+ void Swap(A *other);
+};
+
+struct pair {
+ int first;
+ A *second;
+};
+
+struct map {
+public:
+ void swap(map &x);
+ pair find(int x);
+};
+
+void run(A *annotations) {
+ map new_annotations;
+
+ auto &annotation = *annotations;
+ auto new_it = new_annotations.find(5);
+ auto &new_anotation = new_it.second; // expected-note {{'new_anotation' declared here}}
+ new_annotation->Swap(&annotation); // expected-error {{use of undeclared identifier 'new_annotation'; did you mean 'new_anotation'?}}
+}
+}