diff options
author | Kaelyn Uhrain <rikka@google.com> | 2013-07-08 23:13:44 +0000 |
---|---|---|
committer | Kaelyn Uhrain <rikka@google.com> | 2013-07-08 23:13:44 +0000 |
commit | 476c823ec8fdcc33158ee296e0416ceec8426de6 (patch) | |
tree | 5a717f02c4cc3b7b87a563959649a2a7fc5f5be9 /clang/test/FixIt/typo.cpp | |
parent | 53e721980ba35e6e79c40c0590048b1824112395 (diff) | |
download | bcm5719-llvm-476c823ec8fdcc33158ee296e0416ceec8426de6.tar.gz bcm5719-llvm-476c823ec8fdcc33158ee296e0416ceec8426de6.zip |
Attempt typo correction for function calls with the wrong number of arguments.
Combined with typo correction's new ability to apply global/absolute nested
name specifiers to possible corrections, cases such as in PR12287 where the
desired function is being shadowed by a lexically closer function with the
same name but a different number of parameters will now include a FixIt.
On a side note, since the test for this change caused
test/SemaCXX/typo-correction.cpp to exceed the typo correction limit for
a single file, I've included a test case for exceeding the limit and added
some comments to both the original and part two of typo-correction.cpp
warning future editors of the files about the limit.
llvm-svn: 185881
Diffstat (limited to 'clang/test/FixIt/typo.cpp')
-rw-r--r-- | clang/test/FixIt/typo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/FixIt/typo.cpp b/clang/test/FixIt/typo.cpp index 87df1c07f34..2a743991be4 100644 --- a/clang/test/FixIt/typo.cpp +++ b/clang/test/FixIt/typo.cpp @@ -127,3 +127,11 @@ void func2() { // to replace base::i with derived::i as we would for other qualified name misspellings. // d.base::i = 3; } + +class A { + void bar(int); +}; +void bar(int, int); // expected-note{{'::bar' declared here}} +void A::bar(int x) { + bar(x, 5); // expected-error{{too many arguments to function call, expected 1, have 2; did you mean '::bar'?}} +} |