Home | History | Annotate | Download | only in SemaCXX
      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 
      8 namespace PR12287 {
      9 class zif {
     10   void nab(int);
     11 };
     12 void nab();  // expected-note{{'::PR12287::nab' declared here}}
     13 void 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 
     18 namespace TemplateFunction {
     19 template <class T>  // expected-note {{'::TemplateFunction::A' declared here}}
     20 void A(T) { }
     21 
     22 template <class T>  // expected-note {{'::TemplateFunction::B' declared here}}
     23 void B(T) { }
     24 
     25 class Foo {
     26  public:
     27   void A(int, int) {}
     28   void B() {}
     29 };
     30 
     31 void 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