Fixes PR21925!
llvm-svn: 224380
auto TyposResolved = DelayedTypos.size();
auto Result = TransformTypos(*this, Filter).Transform(E);
TyposResolved -= DelayedTypos.size();
- if (TyposResolved) {
+ if (Result.isInvalid() || Result.get() != E) {
ExprEvalContexts.back().NumTypos -= TyposResolved;
return Result;
}
+ assert(TyposResolved == 0 && "Corrected typo but got same Expr back?");
}
return E;
}
// expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean 'result'?}}
Overload(resulta);
}
+
+namespace PR21925 {
+struct X {
+ int get() { return 7; } // expected-note {{'get' declared here}}
+};
+void test() {
+ X variable; // expected-note {{'variable' declared here}}
+
+ // expected-error@+2 {{use of undeclared identifier 'variableX'; did you mean 'variable'?}}
+ // expected-error@+1 {{no member named 'getX' in 'PR21925::X'; did you mean 'get'?}}
+ int x = variableX.getX();
+}
+}