summaryrefslogtreecommitdiff
path: root/test/SemaCXX/typo-correction-pt2.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2013-07-31 00:48:10 +0000
committerRichard Trieu <rtrieu@google.com>2013-07-31 00:48:10 +0000
commit89310785fe44470da0c1c1eefa54ad9c6dae8e78 (patch)
tree872e75259f184d35e5f56bfb702e05bd86e4e9da /test/SemaCXX/typo-correction-pt2.cpp
parent28803ba0cd8a5d13d104af96aadf72dca4160a7f (diff)
downloadclang-89310785fe44470da0c1c1eefa54ad9c6dae8e78.tar.gz
Fix a crasher than manifests when typo correction suggests a function template.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/typo-correction-pt2.cpp')
-rw-r--r--test/SemaCXX/typo-correction-pt2.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaCXX/typo-correction-pt2.cpp b/test/SemaCXX/typo-correction-pt2.cpp
index ee4971709f..c79a869b5a 100644
--- a/test/SemaCXX/typo-correction-pt2.cpp
+++ b/test/SemaCXX/typo-correction-pt2.cpp
@@ -14,3 +14,22 @@ void zif::nab(int) {
nab(); // expected-error{{too few arguments to function call, expected 1, have 0; did you mean '::PR12287::nab'?}}
}
}
+
+namespace TemplateFunction {
+template <class T> // expected-note {{'::TemplateFunction::A' declared here}}
+void A(T) { }
+
+template <class T> // expected-note {{'::TemplateFunction::B' declared here}}
+void B(T) { }
+
+class Foo {
+ public:
+ void A(int, int) {}
+ void B() {}
+};
+
+void test(Foo F, int num) {
+ F.A(num); // expected-error {{too few arguments to function call, expected 2, have 1; did you mean '::TemplateFunction::A'?}}
+ F.B(num); // expected-error {{too many arguments to function call, expected 0, have 1; did you mean '::TemplateFunction::B'?}}
+}
+}