summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/typo-correction-delayed.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2014-12-16 22:02:06 +0000
committerNick Lewycky <nicholas@mxc.ca>2014-12-16 22:02:06 +0000
commita4891bac9b285821ff2e23292db8037c0f336c78 (patch)
tree308aa275a685ee027659245e43de2cb7db1fe69b /test/SemaCXX/typo-correction-delayed.cpp
parent046ea41e0a46efede23805cd80a4d132ed75d799 (diff)
Look at whether TransformTypos returned a different Expr instead of looking at the number of uncorrected typos before and after. Correcting one typo may produce an expression with another TypoExpr in it, leading to matching counts even though a typo was corrected.
Fixes PR21925! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224380 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/typo-correction-delayed.cpp')
-rw-r--r--test/SemaCXX/typo-correction-delayed.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correction-delayed.cpp
index 7879d299d0..c91fb6ca65 100644
--- a/test/SemaCXX/typo-correction-delayed.cpp
+++ b/test/SemaCXX/typo-correction-delayed.cpp
@@ -130,3 +130,16 @@ void UseOverload() {
// 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();
+}
+}