diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2014-12-16 22:02:06 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2014-12-16 22:02:06 +0000 |
commit | a4891bac9b285821ff2e23292db8037c0f336c78 (patch) | |
tree | 308aa275a685ee027659245e43de2cb7db1fe69b /test/SemaCXX/typo-correction-delayed.cpp | |
parent | 046ea41e0a46efede23805cd80a4d132ed75d799 (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.cpp | 13 |
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(); +} +} |