typo-correction-pt2.cpp revision 2d67097ad41f4c2fe82ebce3f587e06498f1bd71
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-c++11-extensions %s
2//
3// FIXME: This file is overflow from test/SemaCXX/typo-correction.cpp due to a
4// hard-coded limit of 20 different typo corrections Sema::CorrectTypo will
5// attempt within a single file (which is to avoid having very broken files take
6// minutes to finally be rejected by the parser).
7
8namespace PR12287 {
9class zif {
10  void nab(int);
11};
12void nab();  // expected-note{{'::PR12287::nab' declared here}}
13void zif::nab(int) {
14  nab();  // expected-error{{too few arguments to function call, expected 1, have 0; did you mean '::PR12287::nab'?}}
15}
16}
17
18namespace TemplateFunction {
19template <class T>
20void A(T) { }  // expected-note {{'::TemplateFunction::A' declared here}}
21
22template <class T>
23void B(T) { }  // expected-note {{'::TemplateFunction::B' declared here}}
24
25class Foo {
26 public:
27  void A(int, int) {}
28  void B() {}
29};
30
31void test(Foo F, int num) {
32  F.A(num);  // expected-error {{too few arguments to function call, expected 2, have 1; did you mean '::TemplateFunction::A'?}}
33  F.B(num);  // expected-error {{too many arguments to function call, expected 0, have 1; did you mean '::TemplateFunction::B'?}}
34}
35}
36